Replacing strictEqual-assertion with a more useful QUnit.push that includes the expec...
[lhc/web/wiklou.git] / index.php
index 4f8950c..66693c5 100644 (file)
--- a/index.php
+++ b/index.php
@@ -64,7 +64,11 @@ 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' );
+}
 
 try {
        wfIndexMain();
@@ -92,7 +96,9 @@ function wfIndexMain() {
                        } else {
                                echo "Waiting for a database server: $lag seconds lagged\n";
                        }
-                       return;
+                       wfProfileOut( 'index.php-setup' );
+                       wfProfileOut( 'index.php' );
+                       exit;
                }
        }
 
@@ -112,7 +118,7 @@ function wfIndexMain() {
                $dispatcher->performAction();
                wfProfileOut( 'index.php' );
                $mediaWiki->restInPeace();
-               return;
+               exit;
        }
 
        if ( $wgUseFileCache && $wgTitle !== null ) {
@@ -124,19 +130,19 @@ function wfIndexMain() {
                        $cache = new HTMLFileCache( $wgTitle, $action );
                        if ( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
                                /* Check incoming headers to see if client has this cached */
-                               if ( !$context->output->checkLastModified( $cache->fileCacheTime() ) ) {
+                               if ( !$context->getOutput()->checkLastModified( $cache->fileCacheTime() ) ) {
                                        $cache->loadFromFileCache();
                                }
                                # Do any stats increment/watchlist stuff
                                $article = Article::newFromTitle( $wgTitle, $context );
                                $article->viewUpdates();
                                # Tell OutputPage that output is taken care of
-                               $context->output->disable();
+                               $context->getOutput()->disable();
                                wfProfileOut( 'index.php-filecache' );
                                $mediaWiki->finalCleanup();
                                wfProfileOut( 'index.php' );
                                $mediaWiki->restInPeace();
-                               return;
+                               exit;
                        }
                }
                wfProfileOut( 'index.php-filecache' );
@@ -174,9 +180,15 @@ function wfDie( $errorMsg ){
        $version = isset( $wgVersion ) && $wgVersion
                ? htmlspecialchars( $wgVersion )
                : '';
+
+       $script = $_SERVER['SCRIPT_NAME'];
+       $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
+       $path = str_replace( '//', '/', $path );
+
        $logo = isset( $wgLogo ) && $wgLogo
                ? $wgLogo
-               : 'http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png';
+               : $path . 'skins/common/images/mediawiki.png';
+       $encLogo = htmlspecialchars( $logo );
 
        header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 );
        header( 'Content-type: text/html; charset=UTF-8' );
@@ -208,7 +220,7 @@ function wfDie( $errorMsg ){
                </style>
        </head>
        <body>
-               <img src="<?php echo $logo; ?>" alt='The MediaWiki logo' />
+               <img src="<?php echo $encLogo; ?>" alt='The MediaWiki logo' />
                <h1>MediaWiki <?php echo $version; ?> internal error</h1>
                <div class='error'> <?php echo $errorMsg; ?> </div>
        </body>