From 0c0c2dcde73edcbf66ad66c61d4897a2fe02d9e1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 26 Sep 2004 08:06:04 +0000 Subject: [PATCH] protection from multiple includes (from REL1_3A) --- includes/SiteConfiguration.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index fd4efc5e13..1abe48d8e9 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -11,6 +11,15 @@ * * @package MediaWiki */ + +/** + * The include paths change after this file is included from commandLine.inc, + * meaning that require_once() fails to detect that it is including the same + * file again. We use DIY C-style protection as a workaround. + */ +if (!defined('SITE_CONFIGURATION')) { +define('SITE_CONFIGURATION', 1); + class SiteConfiguration { var $suffixes, $wikis, $settings; var $localDatabases; @@ -84,6 +93,6 @@ class SiteConfiguration { return array( $site, $lang ); } } - +} ?> -- 2.20.1