From ea4b9df4086c07aea311ae5ecd9e0339535e6554 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Thu, 6 Apr 2006 09:14:11 +0000 Subject: [PATCH] Commit some code changes; include_once vs. include. Define framework constants. --- comment.php | 4 +-- docs/NEWS | 8 +++-- exit.php | 2 +- include/compat.inc.php | 7 +++- include/db/db.inc.php | 7 +++- include/functions.inc.php | 46 +++++++++++++++++++------ include/functions_calendars.inc.php | 5 +++ include/functions_comments.inc.php | 5 +++ include/functions_entries.inc.php | 7 +++- include/functions_entries_admin.inc.php | 9 ++++- include/functions_images.inc.php | 5 +++ include/functions_installer.inc.php | 5 +++ include/functions_permalinks.inc.php | 5 +++ include/functions_plugins_admin.inc.php | 5 +++ include/functions_rss.inc.php | 5 +++ include/functions_trackbacks.inc.php | 5 +++ include/functions_upgrader.inc.php | 5 +++ include/genpage.inc.php | 16 ++++++--- include/lang.inc.php | 2 +- include/plugin_api.inc.php | 15 ++++++-- index.php | 22 ++++++------ rss.php | 8 +++-- serendipity.css.php | 4 ++- serendipity_admin.php | 8 ++--- serendipity_define.js.php | 2 +- serendipity_xmlrpc.php | 4 ++- sql/db.sql | 1 + wfwcomment.php | 2 +- 28 files changed, 169 insertions(+), 50 deletions(-) diff --git a/comment.php b/comment.php index f849e14..2aa7502 100644 --- a/comment.php +++ b/comment.php @@ -2,8 +2,8 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -include_once('serendipity_config.inc.php'); -include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; +include('serendipity_config.inc.php'); +include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; header('Content-Type: text/html; charset=' . LANG_CHARSET); diff --git a/docs/NEWS b/docs/NEWS index 1ebda64..4fc4d47 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,10 +3,14 @@ Version 1.1-alpha1() ------------------------------------------------------------------------ + * Create a new index on the plugin DB table, optimize fetching config + values for plugins. Load language file when permissions could not + allow reading the config file. (garvinhicking) + * Fix blocking site during file requests by writing session data to disk. Thanks to jgoerzen! (garvinhicking) - * Make categories sidebar plugin able to only show categories + * Make categories sidebar plugin able to only show categories readable for logged in user (garvinhicking) * Fix getting multiple images for directories that were put into @@ -53,7 +57,7 @@ Version 1.0 () * Fix UTF-8 encoding of $i18n_filename_* variables for building permalinks (Bug #1461754, Thanks to Kim Sullivan) (garvinhicking) - + * Fix messing up comment count when deleting a trackback from admin panel (garvinhicking) diff --git a/exit.php b/exit.php index b3554fc..98c5c8e 100644 --- a/exit.php +++ b/exit.php @@ -2,7 +2,7 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -include_once 'serendipity_config.inc.php'; +include 'serendipity_config.inc.php'; $url = $serendipity['baseURL']; diff --git a/include/compat.inc.php b/include/compat.inc.php index 4f380b8..cf79b9e 100644 --- a/include/compat.inc.php +++ b/include/compat.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_COMPAT')) { + return; +} +@define('S9Y_FRAMEWORK_COMPAT', true); + $serendipity = array(); @ini_set('magic_quotes_runtime', 'off'); @@ -235,7 +240,7 @@ function serendipity_detectLang($use_include = false) { $preferred_language = strtolower(preg_replace('@^([^\-_;]*)_?.*$@', '\1', $lang)); if (in_array($preferred_language, $supported_languages)) { if ($use_include) { - @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php'); + @include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php'); $serendipity['autolang'] = $preferred_language; } return $preferred_language; diff --git a/include/db/db.inc.php b/include/db/db.inc.php index c891c40..7dd2783 100644 --- a/include/db/db.inc.php +++ b/include/db/db.inc.php @@ -2,7 +2,12 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -if (@include_once(S9Y_INCLUDE_PATH . "include/db/{$serendipity['dbType']}.inc.php")) { +if (defined('S9Y_FRAMEWORK_DB')) { + return; +} +@define('S9Y_FRAMEWORK_DB', true); + +if (@include(S9Y_INCLUDE_PATH . "include/db/{$serendipity['dbType']}.inc.php")) { @define('S9Y_DB_INCLUDED', TRUE); } diff --git a/include/functions.inc.php b/include/functions.inc.php index 1d0529a..eb9382d 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -2,18 +2,42 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -$serendipity['imageList'] = array(); -include_once(S9Y_INCLUDE_PATH . "include/db/db.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/compat.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_config.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_images.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_entries.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_comments.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_permalinks.inc.php"); -include_once(S9Y_INCLUDE_PATH . "include/functions_smarty.inc.php"); +if (defined('S9Y_FRAMEWORK_FUNCTIONS')) { + return; +} +@define('S9Y_FRAMEWORK_FUNCTIONS', true); +$serendipity['imageList'] = array(); +if (!defined('S9Y_FRAMEWORK_DB')) { + include(S9Y_INCLUDE_PATH . "include/db/db.inc.php"); +} +if (!defined('S9Y_FRAMEWORK_COMPAT')) { + include(S9Y_INCLUDE_PATH . "include/compat.inc.php"); +} +if (!defined('S9Y_FRAMEWORK_CONFIG')) { + include(S9Y_INCLUDE_PATH . "include/functions_config.inc.php"); +} +if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) { + include(S9Y_INCLUDE_PATH . "include/plugin_api.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 * diff --git a/include/functions_calendars.inc.php b/include/functions_calendars.inc.php index 6cfb613..e25ffae 100644 --- a/include/functions_calendars.inc.php +++ b/include/functions_calendars.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_CALENDARS')) { + return; +} +@define('S9Y_FRAMEWORK_CALENDARS', true); + /** * Gregorian to Persian Convertor * diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index e292926..ed3fa7a 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_COMMENTS')) { + return; +} +@define('S9Y_FRAMEWORK_COMMENTS', true); + /** * Store the personal details of a commenting user in a cookie (or delete that cookie) * diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 2501b15..03a074e 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_ENTRIES')) { + return; +} +@define('S9Y_FRAMEWORK_ENTRIES', true); + /** * Delete a category or range of categories * @@ -1060,7 +1065,7 @@ function serendipity_purgeEntry($id, $timestamp = null) { function serendipity_updertEntry($entry) { global $serendipity; - include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; + include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; $errors = array(); serendipity_plugin_api::hook_event('backend_entry_updertEntry', $errors, $entry); diff --git a/include/functions_entries_admin.inc.php b/include/functions_entries_admin.inc.php index 7d5d433..4effa9f 100644 --- a/include/functions_entries_admin.inc.php +++ b/include/functions_entries_admin.inc.php @@ -2,7 +2,14 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -include_once(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php"); +if (defined('S9Y_FRAMEWORK_ENTRIES_ADMIN')) { + return; +} +@define('S9Y_FRAMEWORK_ENTRIES_ADMIN', true); + +if (!defined('S9Y_FRAMEWORK_TRACKBACKS')) { + include(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php"); +} /** * Prints the form for editing/creating new blog entries diff --git a/include/functions_images.inc.php b/include/functions_images.inc.php index e33affa..9b24023 100644 --- a/include/functions_images.inc.php +++ b/include/functions_images.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_IMAGES')) { + return; +} +@define('S9Y_FRAMEWORK_IMAGES', true); + /** * Check if an uploaded file is "evil" * diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index 07c9eab..cc91f4b 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -3,6 +3,11 @@ # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_INSTALLER')) { + return; +} +@define('S9Y_FRAMEWORK_INSTALLER', true); + /** * Convert a PHP Ini setting to a boolean flag * diff --git a/include/functions_permalinks.inc.php b/include/functions_permalinks.inc.php index de575a8..fd4557b 100644 --- a/include/functions_permalinks.inc.php +++ b/include/functions_permalinks.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_PERMALINKS')) { + return; +} +@define('S9Y_FRAMEWORK_PERMALINKS', true); + /** * Converts a string into a filename that can be used safely in HTTP URLs * diff --git a/include/functions_plugins_admin.inc.php b/include/functions_plugins_admin.inc.php index 44fefff..bfa9933 100644 --- a/include/functions_plugins_admin.inc.php +++ b/include/functions_plugins_admin.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_PLUGINS_ADMIN')) { + return; +} +@define('S9Y_FRAMEWORK_PLUGINS_ADMIN', true); + /** * Returns the name of a usergroup. * diff --git a/include/functions_rss.inc.php b/include/functions_rss.inc.php index af17010..12e5970 100644 --- a/include/functions_rss.inc.php +++ b/include/functions_rss.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_RSS')) { + return; +} +@define('S9Y_FRAMEWORK_RSS', true); + /** * Parses entries to display them for RSS/Atom feeds to be passed on to generic Smarty templates * diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 17cdc14..83f3bb9 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_TRACKBACKS')) { + return; +} +@define('S9Y_FRAMEWORK_TRACKBACKS', true); + /** * Check a HTTP response if it is a valid XML trackback response * diff --git a/include/functions_upgrader.inc.php b/include/functions_upgrader.inc.php index 6045123..515bcf5 100644 --- a/include/functions_upgrader.inc.php +++ b/include/functions_upgrader.inc.php @@ -2,6 +2,11 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +if (defined('S9Y_FRAMEWORK_UPGRADER')) { + return; +} +@define('S9Y_FRAMEWORK_UPGRADER', true); + /** * This is a list of functions that are used by the upgrader. Define functions here that * are not used within usual Serendipity control flow diff --git a/include/genpage.inc.php b/include/genpage.inc.php index b71ed68..9ade1a7 100644 --- a/include/genpage.inc.php +++ b/include/genpage.inc.php @@ -2,9 +2,17 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details -include_once('serendipity_config.inc.php'); -include_once(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php'); -include_once(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php'); +if (!defined('S9Y_FRAMEWORK')) { + include('serendipity_config.inc.php'); +} + +if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) { + include(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php'); +} + +if (!defined('S9Y_FRAMEWORK_PLUGIN_INTERNAL')) { + include(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php'); +} $uri_addData = array( 'startpage' => false, @@ -27,7 +35,7 @@ $serendipity['smarty']->assign( if ($serendipity['smarty_raw_mode']) { /* For BC reasons, we have to ask for layout.php */ - @include_once(serendipity_getTemplateFile('layout.php', 'serendipityPath')); + @include(serendipity_getTemplateFile('layout.php', 'serendipityPath')); } else { switch ($serendipity['GET']['action']) { // User wants to read the diary diff --git a/include/lang.inc.php b/include/lang.inc.php index 1b13a26..a0bf0e9 100644 --- a/include/lang.inc.php +++ b/include/lang.inc.php @@ -17,7 +17,7 @@ if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) { // Do fallback to english if (IS_installed === false || (defined('IS_up2date') && IS_up2date === false)) { - @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php'); + @include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php'); } } diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index 0eef23b..04eb621 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -6,7 +6,14 @@ if (IN_serendipity !== true) { die ('Don\'t hack!'); } -include_once S9Y_INCLUDE_PATH . 'include/functions.inc.php'; +if (defined('S9Y_FRAMEWORK_PLUGIN_API')) { + return; +} +@define('S9Y_FRAMEWORK_PLUGIN_API', true); + +if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) { + include S9Y_INCLUDE_PATH . 'include/functions.inc.php'; +} /* This file defines the plugin API for serendipity. * By extending these classes, you can add your own code @@ -534,7 +541,7 @@ class serendipity_plugin_api { if (!class_exists($class_name) && !empty($pluginFile)) { // $serendipity['debug']['pluginload'][] = "Classname does not exist. Including $pluginFile."; - include_once($pluginFile); + include($pluginFile); } if (!class_exists($class_name)) { @@ -1526,6 +1533,8 @@ class serendipity_event extends serendipity_plugin { } } -include_once S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php'; +if (!defined('S9Y_FRAMEWORK_PLUGIN_INTERNAL')) { + include S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php'; +} /* vim: set sts=4 ts=4 expandtab : */ diff --git a/index.php b/index.php index b6c04b1..561b24c 100644 --- a/index.php +++ b/index.php @@ -21,7 +21,7 @@ header('X-Blog: Serendipity'); // Used for installer detection // Session are needed to also remember an autologin user on the frontend ob_start(); -include_once('serendipity_config.inc.php'); +include('serendipity_config.inc.php'); header('Content-Type: text/html; charset='. LANG_CHARSET); $track_referer = true; $uri = $_SERVER['REQUEST_URI']; @@ -201,7 +201,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } ob_start(); - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); $data = ob_get_contents(); ob_end_clean(); @@ -255,7 +255,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } ob_start(); - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); $data = ob_get_contents(); ob_end_clean(); @@ -289,7 +289,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } ob_start(); - include_once(S9Y_INCLUDE_PATH . 'rss.php'); + include(S9Y_INCLUDE_PATH . 'rss.php'); $data = ob_get_contents(); ob_end_clean(); @@ -328,7 +328,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } } - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); } else if (preg_match(PAT_PLUGIN, $uri, $matches)) { serendipity_plugin_api::hook_event('external_plugin', $matches[2]); if (!defined('NO_EXIT')) { @@ -373,7 +373,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['head_title'] = $cInfo['category_name']; $serendipity['head_subtitle'] = $serendipity['blogTitle']; - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); } else if ($is_multiauth || preg_match(PAT_PERMALINK_AUTHORS, $uri, $matches)) { if ($is_multiauth) { $serendipity['GET']['viewAuthor'] = implode(';', $serendipity['POST']['multiAuth']); @@ -410,7 +410,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['head_title'] = sprintf(ENTRIES_BY, $uInfo[0]['realname']); $serendipity['head_subtitle'] = $serendipity['blogTitle']; - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); } else if (preg_match(PAT_SEARCH, $uri, $matches)) { $_args = $serendipity['uriArguments']; @@ -435,10 +435,10 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['GET']['action'] = 'search'; $serendipity['GET']['searchTerm'] = urldecode(htmlspecialchars(strip_tags(implode(' ', $search)))); - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); } elseif (preg_match(PAT_CSS, $uri, $matches)) { $css_mode = $matches[1]; - include_once(S9Y_INCLUDE_PATH . 'serendipity.css.php'); + include(S9Y_INCLUDE_PATH . 'serendipity.css.php'); exit; } else if (preg_match('@/(index(\.php|\.html)?)|'. preg_quote($serendipity['indexFile']) .'@', $uri) || preg_match('@^/' . preg_quote(trim($serendipity['serendipityHTTPPath'], '/')) . '/?(\?.*)?$@', $uri)) { @@ -449,10 +449,10 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['uriArguments'][] = PATH_ARCHIVES; } - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); } else { header('HTTP/1.0 404 Not found'); - include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); + include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); // printf('
' . DOCUMENT_NOT_FOUND . '
', $uri); } diff --git a/rss.php b/rss.php index 101f1e7..c1167e4 100644 --- a/rss.php +++ b/rss.php @@ -4,8 +4,8 @@ header('Content-Type: text/xml; charset=utf-8'); session_cache_limiter('public'); -include_once('serendipity_config.inc.php'); -include_once(S9Y_INCLUDE_PATH . 'include/functions_rss.inc.php'); +include('serendipity_config.inc.php'); +include(S9Y_INCLUDE_PATH . 'include/functions_rss.inc.php'); $version = $_GET['version']; $description = $serendipity['blogDescription']; @@ -111,7 +111,9 @@ $metadata = array( 'version' => $version ); -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'); +} $plugins = serendipity_plugin_api::enum_plugins(); if (is_array($plugins)) { diff --git a/serendipity.css.php b/serendipity.css.php index b7019ed..e8ea137 100644 --- a/serendipity.css.php +++ b/serendipity.css.php @@ -8,7 +8,9 @@ define('IN_upgrader', true); define('IN_CSS', true); session_cache_limiter('public'); -include_once('serendipity_config.inc.php'); +if (!defined('S9Y_FRAMEWORK')) { + include('serendipity_config.inc.php'); +} if (!isset($css_mode)) { if (!empty($serendipity['GET']['css_mode'])) { diff --git a/serendipity_admin.php b/serendipity_admin.php index 5d5cd98..6c4ce54 100644 --- a/serendipity_admin.php +++ b/serendipity_admin.php @@ -11,9 +11,9 @@ include('serendipity_config.inc.php'); header('Content-Type: text/html; charset=' . LANG_CHARSET); if (IS_installed === false) { - require_once(S9Y_INCLUDE_PATH . 'include/functions_permalinks.inc.php'); - require_once(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php'); - require_once S9Y_INCLUDE_PATH . 'include/functions_config.inc.php'; + require(S9Y_INCLUDE_PATH . 'include/functions_permalinks.inc.php'); + require(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php'); + require(S9Y_INCLUDE_PATH . 'include/functions_config.inc.php'); $css_file = 'serendipity.css.php?serendipity[css_mode]=serendipity_admin.css'; } else { $css_file = serendipity_rewriteURL('serendipity_admin.css'); @@ -114,7 +114,7 @@ if (!isset($serendipity['serendipityPath']) || IS_installed === false || IS_up2d } ?> - +