X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebStart.php;h=7bc30390749146f55ff7bb36ffeae454c2589f63;hb=93faec7fe0e470f63972c27b2996e9c475798313;hp=adce346b7f5f9b8857d17841679d1ea08f7c5e18;hpb=f6a7f38a000f7b390f85c52ac9c14fe381949c37;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebStart.php b/includes/WebStart.php index adce346b7f..7bc3039074 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -26,31 +26,12 @@ * @file */ -# Die if register_globals is enabled (PHP <=5.3) -# This must be done before any globals are set by the code -if ( ini_get( 'register_globals' ) ) { - die( 'MediaWiki does not support installations where register_globals is enabled. Please see ' - . 'mediawiki.org ' - . 'for help on how to disable it.' ); -} - -if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { - die( 'MediaWiki does not function when magic quotes are enabled. Please see the ' - . 'PHP Manual ' - . 'for help on how to disable magic quotes.' ); -} - # bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this # We're adding it here so that it's *always* set, even for alternate entry # points and when $wgOut gets disabled or overridden. header( 'X-Content-Type-Options: nosniff' ); -# Approximate $_SERVER['REQUEST_TIME_FLOAT'] for PHP<5.4 -if ( !isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ) { - $_SERVER['REQUEST_TIME_FLOAT'] = microtime( true ); -} - /** * @var float Request start time as fractional seconds since epoch * @deprecated since 1.25; use $_SERVER['REQUEST_TIME_FLOAT'] or @@ -91,7 +72,6 @@ if ( file_exists( "$IP/StartProfiler.php" ) ) { require "$IP/StartProfiler.php"; } - # Load default settings require_once "$IP/includes/DefaultSettings.php"; @@ -103,6 +83,24 @@ if ( is_readable( "$IP/vendor/autoload.php" ) ) { require_once "$IP/vendor/autoload.php"; } +# Assert that composer dependencies were successfully loaded +# Purposely no leading \ due to it breaking HHVM RepoAuthorative mode +# PHP works fine with both versions +# See https://github.com/facebook/hhvm/issues/5833 +if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) { + $message = ( + 'MediaWiki requires the 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 ); @@ -123,7 +121,6 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) { 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