fix list of possible errors for list=blocks
[lhc/web/wiklou.git] / includes / Wiki.php
index 5f593e7..a4a8903 100644 (file)
@@ -62,7 +62,6 @@ class MediaWiki {
                }
 
                $this->context = $context;
-               $this->context->setTitle( $this->parseTitle() );
        }
 
        /**
@@ -133,6 +132,34 @@ class MediaWiki {
                return $this->context->getTitle();
        }
 
+       /**
+        * Returns the name of the action that will be executed.
+        *
+        * @return string: action
+        */
+       public function getAction() {
+               static $action = null;
+
+               if ( $action === null ) {
+                       $action = Action::getActionName( $this->context );
+               }
+
+               return $action;
+       }
+
+       /**
+        * Create an Article object of the appropriate class for the given page.
+        *
+        * @deprecated in 1.18; use Article::newFromTitle() instead
+        * @param $title Title
+        * @param $context IContextSource
+        * @return Article object
+        */
+       public static function articleFromTitle( $title, IContextSource $context ) {
+               wfDeprecated( __METHOD__, '1.18' );
+               return Article::newFromTitle( $title, $context );
+       }
+
        /**
         * Performs the request.
         * - bad titles
@@ -291,34 +318,6 @@ class MediaWiki {
                wfProfileOut( __METHOD__ );
        }
 
-       /**
-        * Create an Article object of the appropriate class for the given page.
-        *
-        * @deprecated in 1.18; use Article::newFromTitle() instead
-        * @param $title Title
-        * @param $context IContextSource
-        * @return Article object
-        */
-       public static function articleFromTitle( $title, IContextSource $context ) {
-               wfDeprecated( __METHOD__, '1.18' );
-               return Article::newFromTitle( $title, $context );
-       }
-
-       /**
-        * Returns the name of the action that will be executed.
-        *
-        * @return string: action
-        */
-       public function getAction() {
-               static $action = null;
-               
-               if ( $action === null ) {
-                       $action = Action::getActionName( $this->context );
-               }
-
-               return $action;
-       }
-
        /**
         * Initialize the main Article object for "standard" actions (view, etc)
         * Create an Article object for the page, following redirects if needed.
@@ -392,64 +391,6 @@ class MediaWiki {
                return $article;
        }
 
-       /**
-        * Do a job from the job queue
-        */
-       private function doJobs() {
-               global $wgJobRunRate;
-
-               if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
-                       return;
-               }
-               if ( $wgJobRunRate < 1 ) {
-                       $max = mt_getrandmax();
-                       if ( mt_rand( 0, $max ) > $max * $wgJobRunRate ) {
-                               return;
-                       }
-                       $n = 1;
-               } else {
-                       $n = intval( $wgJobRunRate );
-               }
-
-               while ( $n-- && false != ( $job = Job::pop() ) ) {
-                       $output = $job->toString() . "\n";
-                       $t = - microtime( true );
-                       $success = $job->run();
-                       $t += microtime( true );
-                       $t = round( $t * 1000 );
-                       if ( !$success ) {
-                               $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
-                       } else {
-                               $output .= "Success, Time: $t ms\n";
-                       }
-                       wfDebugLog( 'jobqueue', $output );
-               }
-       }
-
-       /**
-        * Ends this task peacefully
-        */
-       public function restInPeace() {
-               // Do any deferred jobs
-               DeferredUpdates::doUpdates( 'commit' );
-
-               // Execute a job from the queue
-               $this->doJobs();
-
-               // Log message usage, if $wgAdaptiveMessageCache is set to true
-               MessageCache::logMessages();
-
-               // Log profiling data, e.g. in the database or UDP
-               wfLogProfilingData();
-
-               // Commit and close up!
-               $factory = wfGetLBFactory();
-               $factory->commitMasterChanges();
-               $factory->shutdown();
-
-               wfDebug( "Request ended normally\n" );
-       }
-
        /**
         * Perform one of the "standard" actions
         *
@@ -603,4 +544,62 @@ class MediaWiki {
 
                wfProfileOut( __METHOD__ );
        }
+
+       /**
+        * Ends this task peacefully
+        */
+       public function restInPeace() {
+               // Do any deferred jobs
+               DeferredUpdates::doUpdates( 'commit' );
+
+               // Execute a job from the queue
+               $this->doJobs();
+
+               // Log message usage, if $wgAdaptiveMessageCache is set to true
+               MessageCache::logMessages();
+
+               // Log profiling data, e.g. in the database or UDP
+               wfLogProfilingData();
+
+               // Commit and close up!
+               $factory = wfGetLBFactory();
+               $factory->commitMasterChanges();
+               $factory->shutdown();
+
+               wfDebug( "Request ended normally\n" );
+       }
+
+       /**
+        * Do a job from the job queue
+        */
+       private function doJobs() {
+               global $wgJobRunRate;
+
+               if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
+                       return;
+               }
+               if ( $wgJobRunRate < 1 ) {
+                       $max = mt_getrandmax();
+                       if ( mt_rand( 0, $max ) > $max * $wgJobRunRate ) {
+                               return;
+                       }
+                       $n = 1;
+               } else {
+                       $n = intval( $wgJobRunRate );
+               }
+
+               while ( $n-- && false != ( $job = Job::pop() ) ) {
+                       $output = $job->toString() . "\n";
+                       $t = - microtime( true );
+                       $success = $job->run();
+                       $t += microtime( true );
+                       $t = round( $t * 1000 );
+                       if ( !$success ) {
+                               $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
+                       } else {
+                               $output .= "Success, Time: $t ms\n";
+                       }
+                       wfDebugLog( 'jobqueue', $output );
+               }
+       }
 }