* Added 'target' param to changesfeed to fix total breakage of RCL feed. They were...
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 Jan 2009 18:44:28 +0000 (18:44 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 Jan 2009 18:44:28 +0000 (18:44 +0000)
* Removed extra constant cache key params
* Added feed comments
* Fixed tab space

includes/ChangesFeed.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php

index f3c3e42..33a1f05 100644 (file)
@@ -18,7 +18,7 @@ class ChangesFeed {
                        $feedTitle, htmlspecialchars( $description ), $wgTitle->getFullUrl() );
        }
 
-       public function execute( $feed, $rows, $limit = 0 , $hideminor = false, $lastmod = false ) {
+       public function execute( $feed, $rows, $limit=0, $hideminor=false, $lastmod=false, $target='' ) {
                global $messageMemc, $wgFeedCacheTimeout;
                global $wgFeedClasses, $wgSitename, $wgContLanguageCode;
 
@@ -27,7 +27,7 @@ class ChangesFeed {
                }
 
                $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' );
-               $key = wfMemcKey( $this->type, $this->format, 'limit', $limit, 'minor', $hideminor );
+               $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $target );
 
                FeedUtils::checkPurge($timekey, $key);
 
index 6729c91..31a1781 100644 (file)
@@ -66,7 +66,8 @@ class SpecialRecentChanges extends SpecialPage {
        public function feedSetup() {
                global $wgFeedLimit, $wgRequest;
                $opts = $this->getDefaultOptions();
-               $opts->fetchValuesFromRequest( $wgRequest, array( 'days', 'limit', 'hideminor' ) );
+               # Feed is cached on limit,hideminor; other params would randomly not work
+               $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor' ) );
                $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
                return $opts;
        }
@@ -111,10 +112,10 @@ class SpecialRecentChanges extends SpecialPage {
                        }
                        $batch->execute();
                }
-
+               $target = isset($opts['target']) ? $opts['target'] : ''; // RCL has targets
                if( $feedFormat ) {
                        list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
-                       $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod );
+                       $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod, $target );
                } else {
                        $this->webOutput( $rows, $opts );
                }
index c073435..1982f23 100644 (file)
@@ -22,9 +22,10 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $opts['target'] = $par;
        }
 
-       public function feedSetup(){
+       public function feedSetup() {
                global $wgRequest;
                $opts = parent::feedSetup();
+               # Feed is cached on limit,hideminor,target; other params would randomly not work
                $opts['target'] = $wgRequest->getVal( 'target' );
                return $opts;
        }
@@ -133,9 +134,14 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                                }
                        }
 
-                       $subsql[] = $dbr->selectSQLText( array_merge( $tables, array( $link_table ) ), $select, $conds + $subconds,
-                                                        __METHOD__, array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ),
-                                                        $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) ) );
+                       $subsql[] = $dbr->selectSQLText( 
+                               array_merge( $tables, array( $link_table ) ), 
+                               $select, 
+                               $conds + $subconds,
+                               __METHOD__, 
+                               array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ),
+                               $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) )
+                       );
                }
 
                if( count($subsql) == 0 )