3 if ( php_sapi_name() != 'cli' ) {
4 echo "This is a command-line script.\n";
8 define( 'MEDIAWIKI', 1 );
9 define( 'MW_NO_DB', 1 );
10 define( 'MW_NO_SESSION', 1 );
11 define( 'MW_CONFIG_CALLBACK', 'wfInstallerConfig' );
13 $IP = dirname( dirname( __FILE__
) );
15 function wfInstallerConfig() {
16 // Don't access the database
17 $GLOBALS['wgUseDatabaseMessages'] = false;
19 $GLOBALS['wgShowExceptionDetails'] = true;
21 $GLOBALS['wgExternalLinkTarget'] = '_blank';
24 require_once( "$IP/includes/ProfilerStub.php" );
25 require_once( "$IP/includes/Defines.php" );
26 require_once( "$IP/includes/GlobalFunctions.php" );
27 require_once( "$IP/includes/AutoLoader.php" );
28 require_once( "$IP/includes/Hooks.php" );
29 require_once( "$IP/includes/DefaultSettings.php" );
30 require_once( "$IP/includes/Namespace.php" );
32 $wgContLang = Language
::factory( 'en' ); // will be overridden later
34 // Disable the i18n cache and LoadBalancer
35 Language
::getLocalisationCache()->disableBackend();
36 LBFactory
::disableBackend();
38 $installer = new CliInstaller( $argv );
42 $wgLang = Language
::factory( $langCode );
44 $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT
];
46 $session = $installer->execute( $argv );
48 $_SESSION['installData'] = $session;