96afcf7fca673ad1f1f9e6aa18d39b8c02547cc6
[lhc/web/wiklou.git] / maintenance / install.php
1 <?php
2
3 if ( php_sapi_name() != 'cli' ) {
4 echo "This is a command-line script.\n";
5 exit( 1 );
6 }
7
8 define( 'MEDIAWIKI', 1 );
9 define( 'MW_NO_DB', 1 );
10 define( 'MW_NO_SESSION', 1 );
11 define( 'MW_CONFIG_CALLBACK', 'wfInstallerConfig' );
12
13 $IP = dirname( dirname( __FILE__ ) );
14
15 function wfInstallerConfig() {
16 // Don't access the database
17 $GLOBALS['wgUseDatabaseMessages'] = false;
18 // Debug-friendly
19 $GLOBALS['wgShowExceptionDetails'] = true;
20 // Don't break forms
21 $GLOBALS['wgExternalLinkTarget'] = '_blank';
22 }
23
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" );
31
32 $wgContLang = Language::factory( 'en' ); // will be overridden later
33
34 // Disable the i18n cache and LoadBalancer
35 Language::getLocalisationCache()->disableBackend();
36 LBFactory::disableBackend();
37
38 $installer = new CliInstaller( $argv );
39
40 $langCode = 'en';
41
42 $wgLang = Language::factory( $langCode );
43
44 $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
45
46 $session = $installer->execute( $argv );
47
48 $_SESSION['installData'] = $session;
49