/** * Override the core loadSettings. */ public function loadSettings() { global $IP, $wgNoDBParam, $wgConf, $site, $lang; if ( empty( $wgNoDBParam ) ) { # Check if we were passed a db name if ( isset( $this->mOptions['wiki'] ) ) { $db = $this->mOptions['wiki']; } else { $db = array_shift( $this->mArgs ); } list( $site, $lang ) = $wgConf->siteFromDB( $db ); # If not, work out the language and site the old way if ( is_null( $site ) || is_null( $lang ) ) { if ( !$db ) { $lang = 'aa'; } else { $lang = $db; } if ( isset( $this->mArgs[0] ) ) { $site = array_shift( $this->mArgs ); } else { $site = 'wikipedia'; } } } else { $lang = 'aa'; $site = 'wikipedia'; } putenv( 'wikilang=' . $lang ); ini_set( 'include_path', ".:$IP:$IP/includes:$IP/languages:$IP/maintenance" ); if ( $lang == 'test' && $site == 'wikipedia' ) { if ( !defined( 'TESTWIKI' ) ) { define( 'TESTWIKI', 1 ); } } return MWInit::interpretedPath( '../wmf-config/CommonSettings.php' ); }
MWFunction::call(MW_CONFIG_CALLBACK); } elseif (file_exists("{$IP}/../wmf-config/wikimedia-mode")) { // Load settings, using wikimedia-mode if needed // @todo FIXME: Replace this hack with general farm-friendly code # @todo FIXME: Wikimedia-specific stuff needs to go away to an ext # Maybe a hook? global $cluster; $cluster = 'pmtpa'; require MWInit::interpretedPath('../wmf-config/wgConf.php'); $maintenance->loadWikimediaSettings(); require MWInit::interpretedPath('../wmf-config/CommonSettings.php'); } else { require_once $maintenance->loadSettings(); } if ($maintenance->getDbType() === Maintenance::DB_ADMIN && is_readable("{$IP}/AdminSettings.php")) { require MWInit::interpretedPath('AdminSettings.php'); } $maintenance->finalSetup(); // Some last includes require_once MWInit::compiledPath('includes/Setup.php'); // Much much faster startup than creating a title object $wgTitle = null; // Do the work try { $maintenance->execute(); // Potentially debug globals $maintenance->globals(); } catch (MWException $mwe) { echo $mwe->getText(); exit(1); }
# Start the profiler $wgProfiler = array(); if (file_exists("{$IP}/StartProfiler.php")) { require "{$IP}/StartProfiler.php"; } wfProfileIn('WebStart.php-conf'); # Load default settings # Wikia change - comment out the next line since we include DefaultSettings.php # in LocalSettings.php #require_once( MWInit::compiledPath( "includes/DefaultSettings.php" ) ); if (defined('MW_CONFIG_CALLBACK')) { # Use a callback function to configure MediaWiki MWFunction::call(MW_CONFIG_CALLBACK); } else { if (!defined('MW_CONFIG_FILE')) { define('MW_CONFIG_FILE', MWInit::interpretedPath('LocalSettings.php')); } # LocalSettings.php is the per site customization file. If it does not exist # the wiki installer needs to be launched or the generated file uploaded to # the root wiki directory if (!file_exists(MW_CONFIG_FILE)) { require_once "{$IP}/includes/templates/NoLocalSettings.php"; die; } # Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked) require_once MW_CONFIG_FILE; } if ($wgEnableSelenium) { require_once MWInit::compiledPath("includes/SeleniumWebSettings.php"); } // Wikia change - begin - @author: wladek