X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=load.php;h=ff6d9d7fef15266cfd1be40f52c669eeb2c98900;hb=6d4b3584a13d0cd86bde2b182171cd22935e6d15;hp=89aec9874dbb86bebccb0fe25607c91c3a57f3bd;hpb=3ef857fe4d25c9e5cfd4d73718988df591cf885d;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 89aec9874d..ff6d9d7fef 100644 --- a/load.php +++ b/load.php @@ -23,6 +23,23 @@ * */ +// We want error messages to not be interpreted as CSS or JS +function wfDie( $msg = '' ) { + header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); + echo "/* $msg */"; + die( 1 ); +} + +// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION +require_once( dirname( __FILE__ ) . '/includes/Defines.php' ); + +// Die on unsupported PHP versions +if( !function_exists( 'version_compare' ) || version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ){ + $version = htmlspecialchars( MW_VERSION ); + $phpversion = htmlspecialchars( MW_MIN_PHP_VERSION ); + wfDie( "MediaWiki $version requires at least PHP version $phpversion." ); +} + require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); wfProfileIn( 'load.php' ); @@ -48,5 +65,7 @@ $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest wfProfileOut( 'load.php' ); wfLogProfilingData(); -// Shut down the database -wfGetLBFactory()->shutdown(); +// Shut down the database. foo()->bar() syntax is not supported in PHP4, and this file +// needs to *parse* in PHP4, although we'll never get down here to worry about = vs =& +$lb = wfGetLBFactory(); +$lb->shutdown();