X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebStart.php;h=770e81fa60dc161cdd0198a1ca36e0d42f3c6710;hb=4a5298e6fd361d7f77b1c697a7fd29441966e3b5;hp=428b4ffeb7c36d7d0df6b6af3756057f7dfde513;hpb=ad787f1574b7598868e12d1a4a9bba3ca23d4a8f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebStart.php b/includes/WebStart.php index 428b4ffeb7..770e81fa60 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -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' ); }