Fix incorrect comment
[lhc/web/wiklou.git] / includes / WebStart.php
index ead6d77..766b3bf 100644 (file)
@@ -1,10 +1,13 @@
 <?php
 /**
- * This does the initial setup for a web request.
+ * This does the initial set up for a web request.
  * It does some security checks, starts the profiler and loads the
  * configuration, and optionally loads Setup.php depending on whether
  * MW_NO_SETUP is defined.
  *
+ * Setup.php (if loaded) then sets up GlobalFunctions, the AutoLoader,
+ * and the configuration globals (though not $wgTitle).
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -91,9 +94,6 @@ if ( $IP === false ) {
        }
 }
 
-# Get MWInit class
-require_once "$IP/includes/Init.php";
-
 # Start the autoloader, so that extensions can derive classes from core files
 require_once "$IP/includes/AutoLoader.php";
 
@@ -114,9 +114,14 @@ wfProfileIn( 'WebStart.php-conf' );
 # Load default settings
 require_once "$IP/includes/DefaultSettings.php";
 
+# Load composer's autoloader if present
+if ( is_readable( "$IP/vendor/autoload.php" ) ) {
+       require_once "$IP/vendor/autoload.php";
+}
+
 if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        # Use a callback function to configure MediaWiki
-       MWFunction::call( MW_CONFIG_CALLBACK );
+       call_user_func( MW_CONFIG_CALLBACK );
 } else {
        if ( !defined( 'MW_CONFIG_FILE' ) ) {
                define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
@@ -124,8 +129,8 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
 
        # LocalSettings.php is the per site customization file. If it does not exist
        # the wiki installer needs to be launched or the generated file uploaded to
-       # the root wiki directory
-       if ( !file_exists( MW_CONFIG_FILE ) ) {
+       # the root wiki directory. Give a hint, if it is not readable by the server.
+       if ( !is_readable( MW_CONFIG_FILE ) ) {
                require_once "$IP/includes/templates/NoLocalSettings.php";
                die();
        }
@@ -134,10 +139,6 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        require_once MW_CONFIG_FILE;
 }
 
-if ( $wgEnableSelenium ) {
-       require_once "$IP/includes/SeleniumWebSettings.php";
-}
-
 wfProfileOut( 'WebStart.php-conf' );
 
 wfProfileIn( 'WebStart.php-ob_start' );