MediaWiki REL1_33
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 );
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 global $wgVersion;
52 echo $templateParser->processTemplate(
53 'NoLocalSettings',
54 [
55 'wgVersion' => ( $wgVersion ?? 'VERSION' ),
56 'path' => $path,
57 'localSettingsExists' => file_exists( MW_CONFIG_FILE ),
58 'installerStarted' => $installerStarted
59 ]
60 );
61} catch ( Exception $e ) {
62 echo 'Error: ' . htmlspecialchars( $e->getMessage() );
63}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgVersion
MediaWiki version number.
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
$templateParser
$installerStarted
returning false will NOT prevent logging $e
Definition hooks.txt:2175