use include_once

This commit is contained in:
onli 2013-06-21 18:11:03 +02:00
parent 01a93d5488
commit cbe07715fd
11 changed files with 37 additions and 57 deletions

View File

@ -24,7 +24,7 @@ switch ($serendipity['GET']['adminAction']) {
return true; return true;
} }
include(S9Y_INCLUDE_PATH . "include/functions_images_crop.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/functions_images_crop.inc.php");
$media['is_imgedit'] = true; $media['is_imgedit'] = true;
$media['css_imgedit'] = serendipity_getTemplateFile('admin/imgedit.css'); $media['css_imgedit'] = serendipity_getTemplateFile('admin/imgedit.css');

View File

@ -378,9 +378,9 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
} }
if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) {
include dirname(dirname(__FILE__)) . "/functions.inc.php"; include_once dirname(dirname(__FILE__)) . "/functions.inc.php";
}
if (!is_object($serendipity['smarty'])) { if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init(); serendipity_smarty_init();

View File

@ -120,7 +120,7 @@ if (is_array($template_config)) {
$data["form_token"] = serendipity_setFormToken(); $data["form_token"] = serendipity_setFormToken();
include S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php'; include_once S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php';
$template_vars =& serendipity_loadThemeOptions($template_config); $template_vars =& serendipity_loadThemeOptions($template_config);

View File

@ -342,7 +342,7 @@ function serendipity_detectLang($use_include = false) {
$preferred_language = strtolower(preg_replace('@^([^\-_;]*)_?.*$@', '\1', $lang)); $preferred_language = strtolower(preg_replace('@^([^\-_;]*)_?.*$@', '\1', $lang));
if (in_array($preferred_language, $supported_languages)) { if (in_array($preferred_language, $supported_languages)) {
if ($use_include) { if ($use_include) {
@include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php'); @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php');
$serendipity['autolang'] = $preferred_language; $serendipity['autolang'] = $preferred_language;
} }
return $preferred_language; return $preferred_language;

View File

@ -12,36 +12,18 @@ if (defined('S9Y_FRAMEWORK_FUNCTIONS')) {
@define('S9Y_FRAMEWORK_FUNCTIONS', true); @define('S9Y_FRAMEWORK_FUNCTIONS', true);
$serendipity['imageList'] = array(); $serendipity['imageList'] = array();
if (!defined('S9Y_FRAMEWORK_DB')) {
include(S9Y_INCLUDE_PATH . "include/db/db.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/db/db.inc.php");
} include_once(S9Y_INCLUDE_PATH . "include/compat.inc.php");
if (!defined('S9Y_FRAMEWORK_COMPAT')) { include_once(S9Y_INCLUDE_PATH . "include/functions_config.inc.php");
include(S9Y_INCLUDE_PATH . "include/compat.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php");
} include_once(S9Y_INCLUDE_PATH . "include/functions_images.inc.php");
if (!defined('S9Y_FRAMEWORK_CONFIG')) { include_once(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php");
include(S9Y_INCLUDE_PATH . "include/functions_config.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/functions_entries.inc.php");
} include_once(S9Y_INCLUDE_PATH . "include/functions_comments.inc.php");
if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) { include_once(S9Y_INCLUDE_PATH . "include/functions_permalinks.inc.php");
include(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/functions_smarty.inc.php");
}
if (!defined('S9Y_FRAMEWORK_IMAGES')) {
include(S9Y_INCLUDE_PATH . "include/functions_images.inc.php");
}
if (!defined('S9Y_FRAMEWORK_INSTALLER')) {
include(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php");
}
if (!defined('S9Y_FRAMEWORK_ENTRIES')) {
include(S9Y_INCLUDE_PATH . "include/functions_entries.inc.php");
}
if (!defined('S9Y_FRAMEWORK_COMMENTS')) {
include(S9Y_INCLUDE_PATH . "include/functions_comments.inc.php");
}
if (!defined('S9Y_FRAMEWORK_PERMALINKS')) {
include(S9Y_INCLUDE_PATH . "include/functions_permalinks.inc.php");
}
if (!defined('S9Y_FRAMEWORK_SMARTY')) {
include(S9Y_INCLUDE_PATH . "include/functions_smarty.inc.php");
}
/** /**
* Truncate a string to a specific length, multibyte aware. Appends '...' if successfully truncated * Truncate a string to a specific length, multibyte aware. Appends '...' if successfully truncated
* *

View File

@ -11,9 +11,9 @@ if (defined('S9Y_FRAMEWORK_ENTRIES_ADMIN')) {
} }
@define('S9Y_FRAMEWORK_ENTRIES_ADMIN', true); @define('S9Y_FRAMEWORK_ENTRIES_ADMIN', true);
if (!defined('S9Y_FRAMEWORK_TRACKBACKS')) {
include(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php"); include_once(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php");
}
/** /**
* Prints the form for editing/creating new blog entries * Prints the form for editing/creating new blog entries

View File

@ -410,7 +410,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
if ($cbag->get('type') == 'html') { if ($cbag->get('type') == 'html') {
$htmlnugget[] = $elcount; $htmlnugget[] = $elcount;
if (!function_exists('serendipity_emit_htmlarea_code')) { if (!function_exists('serendipity_emit_htmlarea_code')) {
@include dirname(__FILE__) . '/functions_entries_admin.inc.php'; @include_once dirname(__FILE__) . '/functions_entries_admin.inc.php';
} }
serendipity_emit_htmlarea_code('nuggets', 'nuggets', true); serendipity_emit_htmlarea_code('nuggets', 'nuggets', true);
} }

View File

@ -867,7 +867,7 @@ function serendipity_smarty_init($vars = array()) {
if (!defined('IN_serendipity_admin') && file_exists($template_dir . '/template.inc.php')) { if (!defined('IN_serendipity_admin') && file_exists($template_dir . '/template.inc.php')) {
// If this file exists, a custom template engine will be loaded. // If this file exists, a custom template engine will be loaded.
// Beware: Smarty is used in the Admin backend, despite of this. // Beware: Smarty is used in the Admin backend, despite of this.
include $template_dir . '/template.inc.php'; include_once $template_dir . '/template.inc.php';
} else { } else {
// Set a session variable if Smarty fails: // Set a session variable if Smarty fails:
$prev_smarty = $_SESSION['no_smarty']; $prev_smarty = $_SESSION['no_smarty'];
@ -880,7 +880,7 @@ function serendipity_smarty_init($vars = array()) {
// Default Smarty Engine will be used // Default Smarty Engine will be used
@define('SMARTY_DIR', S9Y_PEAR_PATH . 'Smarty/libs/'); @define('SMARTY_DIR', S9Y_PEAR_PATH . 'Smarty/libs/');
if (!class_exists('Smarty')) { if (!class_exists('Smarty')) {
include SMARTY_DIR . 'Smarty.class.php'; include_once SMARTY_DIR . 'Smarty.class.php';
} }
if (!class_exists('Smarty')) { if (!class_exists('Smarty')) {
@ -889,7 +889,7 @@ function serendipity_smarty_init($vars = array()) {
// Load serendipity smarty class loading class // Load serendipity smarty class loading class
if (!class_exists('Serendipity_Smarty')) { if (!class_exists('Serendipity_Smarty')) {
include 'serendipity_smarty_class.inc.php'; include_once 'serendipity_smarty_class.inc.php';
} }
if (!class_exists('Serendipity_Smarty')) { if (!class_exists('Serendipity_Smarty')) {

View File

@ -6,13 +6,11 @@ if (IN_serendipity !== true) {
die ("Don't hack!"); die ("Don't hack!");
} }
if (!defined('S9Y_FRAMEWORK')) { include_once('serendipity_config.inc.php');
include('serendipity_config.inc.php');
}
include_once(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) {
include(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
}
$uri_addData = array( $uri_addData = array(
'startpage' => false, 'startpage' => false,

View File

@ -16,11 +16,11 @@ if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) {
// The following variable can be set in serendipity_config_local.inc.php to force your templates being able to use language override includes // The following variable can be set in serendipity_config_local.inc.php to force your templates being able to use language override includes
if ($serendipity['useTemplateLanguage']) { if ($serendipity['useTemplateLanguage']) {
if (defined('S9Y_DATA_PATH')) { if (defined('S9Y_DATA_PATH')) {
@include (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php');
@include (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php'); @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php');
} else { } else {
@include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php');
@include (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php'); @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php');
} }
} }
@ -40,7 +40,7 @@ if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) {
// Do fallback to english // Do fallback to english
if (IS_installed === false || (defined('IS_up2date') && IS_up2date === false)) { if (IS_installed === false || (defined('IS_up2date') && IS_up2date === false)) {
@include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php'); @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php');
} }
} }

View File

@ -11,9 +11,9 @@ if (defined('S9Y_FRAMEWORK_PLUGIN_API')) {
} }
@define('S9Y_FRAMEWORK_PLUGIN_API', true); @define('S9Y_FRAMEWORK_PLUGIN_API', true);
if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) {
include S9Y_INCLUDE_PATH . 'include/functions.inc.php'; include_once S9Y_INCLUDE_PATH . 'include/functions.inc.php';
}
/* Core API function mappings /* Core API function mappings