MediaWiki
master
Toggle main menu visibility
NoLocalSettings.php
Go to the documentation of this file.
1
<?php
8
9
# T32219 : can not use pathinfo() on URLs since slashes do not match
10
use
MediaWiki\Html\TemplateParser
;
11
use
Wikimedia\ObjectCache\EmptyBagOStuff
;
12
13
$scriptPath
= dirname( $_SERVER[
'SCRIPT_NAME'
] );
14
$path
=
$scriptPath
!==
'/'
? rtrim(
$scriptPath
,
'/'
) .
'/'
:
'/'
;
15
16
# Check to see if the installer is running
17
if
( !function_exists(
'session_name'
) ) {
18
$installerStarted
=
false
;
19
}
else
{
20
if
( !
wfIniGetBool
(
'session.auto_start'
) ) {
21
session_name(
'mw_installer_session'
);
22
}
23
$oldReporting = error_reporting( E_ALL & ~E_NOTICE );
24
$success
= session_start();
25
error_reporting( $oldReporting );
26
$installerStarted
= (
$success
&& isset( $_SESSION[
'installData'
] ) );
27
}
28
29
$templateParser
=
new
TemplateParser(
null
,
new
EmptyBagOStuff() );
30
31
# Render error page if no LocalSettings file can be found
32
try
{
33
echo
$templateParser
->processTemplate(
34
'NoLocalSettings'
,
35
[
36
'version'
=> ( defined(
'MW_VERSION'
) ?
MW_VERSION
:
'VERSION'
),
37
'path'
=>
$path
,
38
'localSettingsExists'
=> file_exists( MW_CONFIG_FILE ),
39
'installerStarted'
=>
$installerStarted
40
]
41
);
42
}
catch
( Exception $e ) {
43
echo
'Error: '
. htmlspecialchars( $e->getMessage() );
44
}
MW_VERSION
const MW_VERSION
The running version of MediaWiki.
Definition
Defines.php:23
wfIniGetBool
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
Definition
GlobalFunctions.php:1182
$path
$path
Definition
NoLocalSettings.php:14
$templateParser
$templateParser
Definition
NoLocalSettings.php:29
$scriptPath
$scriptPath
Definition
NoLocalSettings.php:13
$installerStarted
$installerStarted
Definition
NoLocalSettings.php:26
$success
$success
Definition
NoLocalSettings.php:24
MediaWiki\Html\TemplateParser
Handles compiling Mustache templates into PHP rendering functions.
Definition
TemplateParser.php:23
Wikimedia\ObjectCache\EmptyBagOStuff
No-op implementation that stores nothing.
Definition
EmptyBagOStuff.php:17
includes
Output
NoLocalSettings.php
Generated on
for MediaWiki by
1.18.0