diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /mw-config/index.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'mw-config/index.php')
-rw-r--r-- | mw-config/index.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mw-config/index.php b/mw-config/index.php new file mode 100644 index 00000000..c00a0d01 --- /dev/null +++ b/mw-config/index.php @@ -0,0 +1,50 @@ +<?php +/** + * New version of MediaWiki web-based config/installation + * + * @file + */ + +define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' ); +define( 'MEDIAWIKI_INSTALL', true ); + +chdir( dirname( dirname( __FILE__ ) ) ); +require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' ); + +wfInstallerMain(); + +function wfInstallerMain() { + global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames; + + $installer = new WebInstaller( $wgRequest ); + + if ( !$installer->startSession() ) { + $installer->finish(); + exit; + } + + $fingerprint = $installer->getFingerprint(); + if ( isset( $_SESSION['installData'][$fingerprint] ) ) { + $session = $_SESSION['installData'][$fingerprint]; + } else { + $session = array(); + } + + if ( isset( $session['settings']['_UserLang'] ) ) { + $langCode = $session['settings']['_UserLang']; + } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) { + $langCode = $wgRequest->getVal( 'UserLang' ); + } else { + $langCode = 'en'; + } + $wgLang = Language::factory( $langCode ); + + $installer->setParserLanguage( $wgLang ); + + $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT]; + + $session = $installer->execute( $session ); + + $_SESSION['installData'][$fingerprint] = $session; + +} |