Merge "CologneBlue rewrite: kill mWatchLinkNum, watchThisPage() is only called once...
[lhc/web/wiklou.git] / mw-config / index.php
1 <?php
2 /**
3 * New version of MediaWiki web-based config/installation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 */
22
23 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
24 define( 'MEDIAWIKI_INSTALL', true );
25
26 chdir( dirname( __DIR__ ) );
27 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
28 require ( 'core/includes/WebStart.php' );
29 } else {
30 require( dirname( __DIR__ ) . '/includes/WebStart.php' );
31 }
32
33 wfInstallerMain();
34
35 function wfInstallerMain() {
36 global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
37
38 $installer = InstallerOverrides::getWebInstaller( $wgRequest );
39
40 if ( !$installer->startSession() ) {
41 $installer->finish();
42 exit;
43 }
44
45 $fingerprint = $installer->getFingerprint();
46 if ( isset( $_SESSION['installData'][$fingerprint] ) ) {
47 $session = $_SESSION['installData'][$fingerprint];
48 } else {
49 $session = array();
50 }
51
52 if ( !is_null( $wgRequest->getVal( 'uselang' ) ) ) {
53 $langCode = $wgRequest->getVal( 'uselang' );
54 } elseif ( isset( $session['settings']['_UserLang'] ) ) {
55 $langCode = $session['settings']['_UserLang'];
56 } else {
57 $langCode = 'en';
58 }
59 $wgLang = Language::factory( $langCode );
60
61 $installer->setParserLanguage( $wgLang );
62
63 $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
64
65 $session = $installer->execute( $session );
66
67 $_SESSION['installData'][$fingerprint] = $session;
68
69 }