Merged ImageFunctions.php into GlobalFunctions.php
[lhc/web/wiklou.git] / includes / Wiki.php
index e5be1da..b20cb95 100644 (file)
@@ -269,11 +269,10 @@ class MediaWiki {
                                $pageView = true;
                                /**
                                 * $wgArticle is deprecated, do not use it.
-                                * This will be removed entirely in 1.20.
                                 * @deprecated since 1.18
                                 */
                                global $wgArticle;
-                               $wgArticle = $article;
+                               $wgArticle = new DeprecatedGlobal( 'wgArticle', $article, '1.18' );
 
                                $this->performAction( $article );
                        } elseif ( is_string( $article ) ) {
@@ -431,9 +430,9 @@ class MediaWiki {
 
                while ( $n-- && false != ( $job = Job::pop() ) ) {
                        $output = $job->toString() . "\n";
-                       $t = -wfTime();
+                       $t = - microtime( true );
                        $success = $job->run();
-                       $t += wfTime();
+                       $t += microtime( true );
                        $t = round( $t * 1000 );
                        if ( !$success ) {
                                $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
@@ -460,11 +459,9 @@ class MediaWiki {
        /**
         * Perform one of the "standard" actions
         *
-        * @param $article Article
+        * @param $page Page
         */
-       private function performAction( Page $article ) {
-               global $wgSquidMaxage;
-
+       private function performAction( Page $page ) {
                wfProfileIn( __METHOD__ );
 
                $request = $this->context->getRequest();
@@ -473,7 +470,7 @@ class MediaWiki {
                $user = $this->context->getUser();
 
                if ( !wfRunHooks( 'MediaWikiPerformAction',
-                       array( $output, $article, $title, $user, $request, $this ) ) )
+                       array( $output, $page, $title, $user, $request, $this ) ) )
                {
                        wfProfileOut( __METHOD__ );
                        return;
@@ -481,14 +478,14 @@ class MediaWiki {
 
                $act = $this->getAction();
 
-               $action = Action::factory( $act, $article );
+               $action = Action::factory( $act, $page );
                if ( $action instanceof Action ) {
                        $action->show();
                        wfProfileOut( __METHOD__ );
                        return;
                }
 
-               if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) {
+               if ( wfRunHooks( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
                        $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
                }