PSR-3 logging ' .
"library to be present. This library is not embedded directly in MediaWiki's " .
"git repository and must be installed separately by the end user.\n\n" .
'Please see mediawiki.org for help on installing ' .
'the required components.'
);
echo $message;
trigger_error( $message, E_USER_ERROR );
die( 1 );
}
if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
# Use a callback function to configure MediaWiki
call_user_func( MW_CONFIG_CALLBACK );
} else {
if ( !defined( 'MW_CONFIG_FILE' ) ) {
define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
}
# LocalSettings.php is the per site customization file. If it does not exist
# the wiki installer needs to be launched or the generated file uploaded to
# the root wiki directory. Give a hint, if it is not readable by the server.
if ( !is_readable( MW_CONFIG_FILE ) ) {
require_once "$IP/includes/NoLocalSettings.php";
die();
}
# Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked)
require_once MW_CONFIG_FILE;
}
# Initialise output buffering
# Check that there is no previous output or previously set up buffers, because
# that would cause us to potentially mix gzip and non-gzip output, creating a
# big mess.
if ( ob_get_level() == 0 ) {
require_once "$IP/includes/OutputHandler.php";
ob_start( 'wfOutputHandler' );
}
require_once "$IP/includes/Setup.php";
# Multiple DBs or commits might be used; keep the request as transactional as possible
if ( isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] === 'POST' ) {
ignore_user_abort( true );
}
if ( !defined( 'MW_API' ) &&
RequestContext::getMain()->getRequest()->getHeader( 'Promise-Non-Write-API-Action' )
) {
header( 'Cache-Control: no-cache' );
header( 'Content-Type: text/html; charset=utf-8' );
HttpStatus::header( 400 );
$error = wfMessage( 'nonwrite-api-promise-error' )->escaped();
$content = <<
$error
EOT;
header( 'Content-Length: ' . strlen( $content ) );
echo $content;
die();
}