36# T17461: Make IE8 turn off content sniffing. Everybody else should ignore this
37# We're adding it here so that it's *always* set, even for alternate entry
38# points and when $wgOut gets disabled or overridden.
41header(
'X-Content-Type-Options: nosniff' );
43# Valid web server entry point, enable includes.
44# Please don't move this line to includes/Defines.php. This line essentially
45# defines a valid entry point. If you put it in includes/Defines.php, then
46# any script that includes it becomes an entry point, thereby defeating
48define(
'MEDIAWIKI',
true );
50# Full path to the installation directory.
51$IP = getenv(
'MW_INSTALL_PATH' );
53 $IP = dirname( __DIR__ );
62 # LocalSettings.php is the per-site customization file. If it does not exist
63 # the wiki installer needs to be launched or the generated file uploaded to
64 # the root wiki directory. Give a hint, if it is not readable by the server.
65 require_once MW_INSTALL_PATH .
'/includes/NoLocalSettings.php';
69require_once
"$IP/includes/BootstrapHelperFunctions.php";
73if ( !defined(
'MW_CONFIG_CALLBACK' ) ) {
75 if ( !is_readable( MW_CONFIG_FILE ) ) {
76 define(
'MW_CONFIG_CALLBACK',
'wfWebStartNoLocalSettings' );
83 if ( ob_get_level() == 0 ) {
84 ob_start(
'MediaWiki\\OutputHandler::handle' );
89if ( !defined(
'MW_SETUP_CALLBACK' ) ) {
90 define(
'MW_SETUP_CALLBACK',
'wfWebStartSetup' );
93require_once
"$IP/includes/Setup.php";
95# Multiple DBs or commits might be used; keep the request as transactional as possible
96if ( isset( $_SERVER[
'REQUEST_METHOD'] ) && $_SERVER[
'REQUEST_METHOD'] ===
'POST' ) {
97 ignore_user_abort(
true );
100if ( !defined(
'MW_API' ) && !defined(
'MW_REST_API' ) &&
101 RequestContext::getMain()->getRequest()->getHeader(
'Promise-Non-Write-API-Action' )
103 header(
'Cache-Control: no-cache' );
104 header(
'Content-Type: text/html; charset=utf-8' );
106 $errorHtml =
wfMessage(
'nonwrite-api-promise-error' )
107 ->useDatabase(
false )
108 ->inContentLanguage()
113<head><meta charset=
"UTF-8" /></head>
120 header(
'Content-Length: ' . strlen(
$content ) );
wfDetectLocalSettingsFile(string $installationPath)
Decide and remember where to load LocalSettings from.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if($IP===false) wfWebStartNoLocalSettings(SettingsBuilder $settings)
if(!defined('MW_CONFIG_CALLBACK')) wfWebStartSetup(SettingsBuilder $settings)
static header( $code)
Output an HTTP status code header.