Close wfProfileIn
[lhc/web/wiklou.git] / index.php
index 4fed9b8..5e5f47c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -64,9 +64,17 @@ ENDL;
 # Initialise common code.  This gives us access to GlobalFunctions, the AutoLoader, and
 # the globals $wgRequest, $wgOut, $wgUser, $wgLang and $wgContLang, amongst others; it
 # does *not* load $wgTitle
-require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+if ( isset( $_SERVER['MW_COMPILED'] ) ) {
+       require ( 'phase3/includes/WebStart.php' );
+} else {
+       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+}
 
-wfIndexMain();
+try {
+       wfIndexMain();
+} catch ( Exception $e ) {
+       MWExceptionHandler::handle( $e );
+}
 
 function wfIndexMain() {
        global $wgRequest, $wgShowHostnames, $mediaWiki, $wgTitle, $wgUseAjax, $wgUseFileCache;
@@ -88,6 +96,8 @@ function wfIndexMain() {
                        } else {
                                echo "Waiting for a database server: $lag seconds lagged\n";
                        }
+                       wfProfileOut( 'index.php-setup' );
+                       wfProfileOut( 'index.php' );
                        return;
                }
        }