Remove most named character references from output
[lhc/web/wiklou.git] / config / new-index.php
1 <?php
2
3 define( 'MW_NO_DB', 1 );
4 define( 'MW_NO_SESSION', 1 );
5 define( 'MW_CONFIG_CALLBACK', 'wfInstallerConfig' );
6
7 function wfInstallerConfig() {
8 // Don't access the database
9 $GLOBALS['wgUseDatabaseMessages'] = false;
10 // Debug-friendly
11 $GLOBALS['wgShowExceptionDetails'] = true;
12 // Don't break forms
13 $GLOBALS['wgExternalLinkTarget'] = '_blank';
14
15 // Extended debugging. Maybe disable before release?
16 $GLOBALS['wgShowSQLErrors'] = true;
17 $GLOBALS['wgShowDBErrorBacktrace'] = true;
18 }
19
20 chdir( ".." );
21 require( './includes/WebStart.php' );
22 require_once( './maintenance/updaters.inc' ); // sigh...
23
24 // Disable the i18n cache and LoadBalancer
25 Language::getLocalisationCache()->disableBackend();
26 LBFactory::disableBackend();
27
28 // Load the installer's i18n file
29 $wgExtensionMessagesFiles['MediawikiInstaller'] = './includes/installer/Installer.i18n.php';
30
31 $installer = new WebInstaller( $wgRequest );
32 $wgParser->setHook( 'doclink', array( $installer, 'docLink' ) );
33
34 if ( !$installer->startSession() ) {
35 $installer->finish();
36 exit;
37 }
38
39 $session = isset( $_SESSION['installData'] ) ? $_SESSION['installData'] : array();
40
41 if ( isset( $session['settings']['_UserLang'] ) ) {
42 $langCode = $session['settings']['_UserLang'];
43 } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
44 $langCode = $wgRequest->getVal( 'UserLang' );
45 } else {
46 $langCode = 'en';
47 }
48 $wgLang = Language::factory( $langCode );
49
50 $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
51
52 $session = $installer->execute( $session );
53
54 $_SESSION['installData'] = $session;
55