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.
39header(
'X-Content-Type-Options: nosniff' );
41# Valid web server entry point, enable includes.
42# Please don't move this line to includes/Defines.php. This line essentially
43# defines a valid entry point. If you put it in includes/Defines.php, then
44# any script that includes it becomes an entry point, thereby defeating
46define(
'MEDIAWIKI',
true );
48# Full path to the installation directory.
49$IP = getenv(
'MW_INSTALL_PATH' );
51 $IP = dirname( __DIR__ );
56if ( !defined(
'MW_CONFIG_CALLBACK' ) ) {
57 if ( !defined(
'MW_CONFIG_FILE' ) ) {
58 define(
'MW_CONFIG_FILE',
"$IP/LocalSettings.php" );
60 if ( !is_readable( MW_CONFIG_FILE ) ) {
62 function wfWebStartNoLocalSettings() {
63 # LocalSettings.php is the per-site customization file. If it does not exist
64 # the wiki installer needs to be launched or the generated file uploaded to
65 # the root wiki directory. Give a hint, if it is not readable by the server.
67 require_once
"$IP/includes/NoLocalSettings.php";
71 define(
'MW_CONFIG_CALLBACK',
'wfWebStartNoLocalSettings' );
76if ( !defined(
'MW_SETUP_CALLBACK' ) ) {
78 function wfWebStartSetup() {
81 if ( ob_get_level() == 0 ) {
82 ob_start(
'MediaWiki\\OutputHandler::handle' );
86 define(
'MW_SETUP_CALLBACK',
'wfWebStartSetup' );
89require_once
"$IP/includes/Setup.php";
91# Multiple DBs or commits might be used; keep the request as transactional as possible
92if ( isset( $_SERVER[
'REQUEST_METHOD'] ) && $_SERVER[
'REQUEST_METHOD'] ===
'POST' ) {
93 ignore_user_abort(
true );
96if ( !defined(
'MW_API' ) && !defined(
'MW_REST_API' ) &&
97 RequestContext::getMain()->getRequest()->getHeader(
'Promise-Non-Write-API-Action' )
99 header(
'Cache-Control: no-cache' );
100 header(
'Content-Type: text/html; charset=utf-8' );
102 $errorHtml =
wfMessage(
'nonwrite-api-promise-error' )
103 ->useDatabase(
false )
104 ->inContentLanguage()
109<head><meta charset=
"UTF-8" /></head>
116 header(
'Content-Length: ' . strlen(
$content ) );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
static header( $code)
Output an HTTP status code header.