Fix return type documentation
[lhc/web/wiklou.git] / includes / WebStart.php
index 428b4ff..770e81f 100644 (file)
@@ -91,17 +91,13 @@ if ( !function_exists( 'version_compare' )
 
 # Start the autoloader, so that extensions can derive classes from core files
 require_once( "$IP/includes/AutoLoader.php" );
+# Load default settings
+require_once( "$IP/includes/DefaultSettings.php" );
 
 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        # Use a callback function to configure MediaWiki
-       require_once( "$IP/includes/DefaultSettings.php" );
-
-       $callback = MW_CONFIG_CALLBACK;
-       # PHP 5.1 doesn't support "class::method" for call_user_func, so split it
-       if ( strpos( $callback, '::' ) !== false ) {
-               $callback = explode( '::', $callback, 2);
-       }
-       call_user_func( $callback );
+       MWFunction::call( MW_CONFIG_CALLBACK );
+       
 } else {
        if ( !defined('MW_CONFIG_FILE') )
                define('MW_CONFIG_FILE', "$IP/LocalSettings.php");
@@ -110,7 +106,6 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        # the wiki installer needs to be launched or the generated file moved from
        # ./config/ to ./
        if( !file_exists( MW_CONFIG_FILE ) ) {
-               require_once( "$IP/includes/DefaultSettings.php" ); # used for printing the version
                require_once( "$IP/includes/templates/NoLocalSettings.php" );
                die();
        }
@@ -127,15 +122,10 @@ wfProfileOut( 'WebStart.php-conf' );
 
 wfProfileIn( 'WebStart.php-ob_start' );
 # 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.
-# In older versions of PHP ob_get_level() returns 0 if there is no buffering or
-# previous output, in newer versions the default output buffer is always set up
-# and ob_get_level() returns 1. In this case we check that the buffer is empty.
-# FIXME: Check that this is the right way to handle this
-if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ( ob_get_level() == 0 || ( ob_get_level() == 1 && ob_get_contents() === '' ) ) ) {
+if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ob_get_level() == 0 ) {
        require_once( "$IP/includes/OutputHandler.php" );
        ob_start( 'wfOutputHandler' );
 }