From: Brion Vibber Date: Wed, 11 Aug 2004 02:08:47 +0000 (+0000) Subject: Fix command-line scripts broken by more aggressive external entry point X-Git-Tag: 1.5.0alpha1~2422 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b5c80fc4710af2975ee52d9106dd2969ff91e00e;p=lhc%2Fweb%2Fwiklou.git Fix command-line scripts broken by more aggressive external entry point protection. --- diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 92e50f41de..10cf5625d6 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -6,6 +6,8 @@ if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { exit(); } +define("MEDIAWIKI",true); + # Process command line arguments # $options becomes an array with keys set to the option names # $optionsWithArgs is an array of GNU-style options that take an argument. The arguments are returned @@ -100,9 +102,9 @@ if ( $sep == ":" && strpos( `hostname`, "wikimedia.org" ) !== false ) { $wgCommandLineMode = true; $DP = $IP; require_once( "$IP/includes/Defines.php" ); - include_once( $settingsFile ); + require_once( $settingsFile ); ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages$sep$IP/maintenance" ); - include_once( "$IP/AdminSettings.php" ); + require_once( "$IP/AdminSettings.php" ); } # Turn off output buffering again, it might have been turned on in the settings files @@ -114,7 +116,6 @@ $wgDBpassword = $wgDBadminpassword; $wgUsePHPTal = false; -define("MEDIAWIKI",true); require_once( "Setup.php" ); require_once( "install-utils.inc" ); $wgTitle = Title::newFromText( "Command line script" );