Merge "Add PreferencesFormPreSave hook"
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 0ef71c4..01ad724 100644 (file)
@@ -60,8 +60,6 @@
  * temporary:       not stored in the database
  *      notificationtimestamp
  *      numberofWatchingusers
- *
- * @todo document functions and variables
  */
 class RecentChange {
        // Constants for the rc_source field.  Extensions may also have
@@ -84,7 +82,7 @@ class RecentChange {
         */
        private $mPerformer = false;
 
-       public $numberofWatchingusers = 0; # Dummy to prevent error message in SpecialRecentchangeslinked
+       public $numberofWatchingusers = 0; # Dummy to prevent error message in SpecialRecentChangesLinked
        public $notificationtimestamp;
 
        /**
@@ -336,14 +334,6 @@ class RecentChange {
                global $wgRCFeeds;
 
                foreach ( $wgRCFeeds as $feed ) {
-                       $engine = self::getEngine( $feed['uri'] );
-
-                       if ( isset( $this->mExtra['actionCommentIRC'] ) ) {
-                               $actionComment = $this->mExtra['actionCommentIRC'];
-                       } else {
-                               $actionComment = null;
-                       }
-
                        $omitBots = isset( $feed['omit_bots'] ) ? $feed['omit_bots'] : false;
 
                        if (
@@ -353,6 +343,14 @@ class RecentChange {
                                continue;
                        }
 
+                       $engine = self::getEngine( $feed['uri'] );
+
+                       if ( isset( $this->mExtra['actionCommentIRC'] ) ) {
+                               $actionComment = $this->mExtra['actionCommentIRC'];
+                       } else {
+                               $actionComment = null;
+                       }
+
                        /** @var $formatter RCFeedFormatter */
                        $formatter = new $feed['formatter']();
                        $line = $formatter->getLine( $feed, $this, $actionComment );
@@ -366,9 +364,9 @@ class RecentChange {
         *
         * @param string $uri URI to get the engine object for
         * @throws MWException
-        * @return object The engine object
+        * @return RCFeedEngine The engine object
         */
-       private static function getEngine( $uri ) {
+       public static function getEngine( $uri ) {
                global $wgRCEngines;
 
                $scheme = parse_url( $uri, PHP_URL_SCHEME );
@@ -546,7 +544,6 @@ class RecentChange {
        /**
         * Makes an entry in the database corresponding to page creation
         * Note: the title object must be loaded with the new id using resetArticleID()
-        * @todo Document parameters and return
         *
         * @param $timestamp
         * @param $title Title