MediaWiki REL1_35
NoLocalSettings.php
Go to the documentation of this file.
1<?php
23# T32219 : can not use pathinfo() on URLs since slashes do not match
25$path = '/';
26foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
27 if ( !preg_match( '/\.(php)$/', $part, $matches ) ) {
28 $path .= "$part/";
29 } else {
30 break;
31 }
32}
33
34# Check to see if the installer is running
35if ( !function_exists( 'session_name' ) ) {
36 $installerStarted = false;
37} else {
38 if ( !wfIniGetBool( 'session.auto_start' ) ) {
39 session_name( 'mw_installer_session' );
40 }
41 $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
42 $success = session_start();
43 error_reporting( $oldReporting );
44 $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
45}
46
48
49# Render error page if no LocalSettings file can be found
50try {
51 echo $templateParser->processTemplate(
52 'NoLocalSettings',
53 [
54 'version' => ( defined( 'MW_VERSION' ) ? MW_VERSION : 'VERSION' ),
55 'path' => $path,
56 'localSettingsExists' => file_exists( MW_CONFIG_FILE ),
57 'installerStarted' => $installerStarted
58 ]
59 );
60} catch ( Exception $e ) {
61 echo 'Error: ' . htmlspecialchars( $e->getMessage() );
62}
const MW_VERSION
The running version of MediaWiki.
Definition Defines.php:40
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
$templateParser
$installerStarted