(bug 23464) File: prefixes are now chopped off during uploading.
[lhc/web/wiklou.git] / load.php
index 89aec98..ff6d9d7 100644 (file)
--- a/load.php
+++ b/load.php
  *
  */
 
+// 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();