Merge "Declare visibility on class properties of RecentChange"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 19 Nov 2013 19:53:15 +0000 (19:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 19 Nov 2013 19:53:15 +0000 (19:53 +0000)
RELEASE-NOTES-1.23
includes/ChangeTags.php
includes/DefaultSettings.php
includes/SpecialPage.php
includes/api/ApiOpenSearch.php
includes/cache/LinkBatch.php
includes/changes/ChangesList.php
includes/changes/OldChangesList.php
includes/changes/RecentChange.php
includes/specials/SpecialContributions.php
resources/Resources.php

index e8af684..d74ade1 100644 (file)
@@ -37,6 +37,8 @@ production.
 * (bug 56033) Add content model to the page information.
 * Added Article::MissingArticleConditions hook to give extensions a chance to
   hide their (unrelated) log entries.
+* Added $wgOpenSearchDefaultLimit defining the default number of entries to show
+  on action=opensearch API call.
 
 === Bug fixes in 1.23 ===
 * (bug 41759) The "updated since last visit" markers (on history pages, recent
index 3c734c4..fd94bea 100644 (file)
@@ -201,9 +201,6 @@ class ChangeTags {
                        // Somebody wants to filter on a tag.
                        // Add an INNER JOIN on change_tag
 
-                       // FORCE INDEX -- change_tags will almost ALWAYS be the correct query plan.
-                       $options['USE INDEX'] = array( 'change_tag' => 'change_tag_tag_id' );
-                       unset( $options['FORCE INDEX'] );
                        $tables[] = 'change_tag';
                        $join_conds['change_tag'] = array( 'INNER JOIN', "ct_$join_cond=$join_cond" );
                        $conds['ct_tag'] = $filter_tag;
index d428910..8faae60 100644 (file)
@@ -5236,6 +5236,12 @@ $wgOpenSearchTemplate = false;
  */
 $wgEnableOpenSearchSuggest = true;
 
+/**
+ * Integer defining default number of entries to show on
+ * OpenSearch call.
+ */
+$wgOpenSearchDefaultLimit = 10;
+
 /**
  * Expiry time for search suggestion responses
  */
index 20571d7..741cce3 100644 (file)
@@ -833,12 +833,10 @@ class SpecialPage {
         * @see wfMessage
         */
        public function msg( /* $args */ ) {
-               // Note: can't use func_get_args() directly as second or later item in
-               // a parameter list until PHP 5.3 or you get a fatal error.
-               // Works fine as the first parameter, which appears elsewhere in the
-               // code base. Sighhhh.
-               $args = func_get_args();
-               $message = call_user_func_array( array( $this->getContext(), 'msg' ), $args );
+               $message = call_user_func_array(
+                       array( $this->getContext(), 'msg' ),
+                       func_get_args()
+               );
                // RequestContext passes context to wfMessage, and the language is set from
                // the context, but setting the language for Message class removes the
                // interface message status, which breaks for example usernameless gender
@@ -877,7 +875,6 @@ class SpecialPage {
        public function getFinalGroupName() {
                global $wgSpecialPageGroups;
                $name = $this->getName();
-               $group = '-';
 
                // Allow overbidding the group from the wiki side
                $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();
index 433b743..4b8578b 100644 (file)
@@ -90,10 +90,12 @@ class ApiOpenSearch extends ApiBase {
        }
 
        public function getAllowedParams() {
+               global $wgOpenSearchDefaultLimit;
+
                return array(
                        'search' => null,
                        'limit' => array(
-                               ApiBase::PARAM_DFLT => 10,
+                               ApiBase::PARAM_DFLT => $wgOpenSearchDefaultLimit,
                                ApiBase::PARAM_TYPE => 'limit',
                                ApiBase::PARAM_MIN => 1,
                                ApiBase::PARAM_MAX => 100,
index 7bb41ac..1a20ab4 100644 (file)
@@ -31,7 +31,7 @@ class LinkBatch {
        /**
         * 2-d array, first index namespace, second index dbkey, value arbitrary
         */
-       var $data = array();
+       public $data = array();
 
        /**
         * For debugging which method is using this class.
index aa3519b..a9c3a67 100644 (file)
@@ -29,13 +29,17 @@ class ChangesList extends ContextSource {
        public $skin;
 
        protected $watchlist = false;
-
+       protected $lastdate;
        protected $message;
+       protected $rc_cache;
+       protected $rcCacheIndex;
+       protected $rclistOpen;
+       protected $rcMoveIndex;
 
        /**
         * Changeslist constructor
         *
-        * @param $obj Skin or IContextSource
+        * @param Skin|IContextSource $obj
         */
        public function __construct( $obj ) {
                if ( $obj instanceof IContextSource ) {
@@ -52,8 +56,8 @@ class ChangesList extends ContextSource {
         * Fetch an appropriate changes list class for the specified context
         * Some users might want to use an enhanced list format, for instance
         *
-        * @param $context IContextSource to use
-        * @return ChangesList|EnhancedChangesList|OldChangesList derivative
+        * @param IContextSource $context
+        * @return ChangesList derivative
         */
        public static function newFromContext( IContextSource $context ) {
                $user = $context->getUser();
@@ -95,7 +99,7 @@ class ChangesList extends ContextSource {
         * Returns the appropriate flags for new page, minor change and patrolling
         * @param array $flags Associative array of 'flag' => Bool
         * @param string $nothing to use for empty space
-        * @return String
+        * @return string
         */
        public function recentChangesFlags( $flags, $nothing = '&#160;' ) {
                global $wgRecentChangesFlags;
@@ -116,7 +120,7 @@ class ChangesList extends ContextSource {
         * "!" respectively, plus it will have an appropriate title and class.
         *
         * @param string $flag One key of $wgRecentChangesFlags
-        * @return String: Raw HTML
+        * @return string Raw HTML
         */
        public static function flag( $flag ) {
                static $flagInfos = null;
@@ -148,7 +152,7 @@ class ChangesList extends ContextSource {
 
        /**
         * Returns text for the start of the tabular part of RC
-        * @return String
+        * @return string
         */
        public function beginRecentChangesList() {
                $this->rc_cache = array();
@@ -163,10 +167,10 @@ class ChangesList extends ContextSource {
 
        /**
         * Show formatted char difference
-        * @param $old Integer: bytes
-        * @param $new Integer: bytes
-        * @param $context IContextSource context to use
-        * @return String
+        * @param int $old Number of bytes
+        * @param int $new Number of bytes
+        * @param IContextSource $context
+        * @return string
         */
        public static function showCharacterDifference( $old, $new, IContextSource $context = null ) {
                global $wgRCChangedSizeThreshold, $wgMiserMode;
@@ -200,12 +204,10 @@ class ChangesList extends ContextSource {
 
                if ( $szdiff === 0 ) {
                        $formattedSizeClass = 'mw-plusminus-null';
-               }
-               if ( $szdiff > 0 ) {
+               } elseif ( $szdiff > 0 ) {
                        $formattedSize = '+' . $formattedSize;
                        $formattedSizeClass = 'mw-plusminus-pos';
-               }
-               if ( $szdiff < 0 ) {
+               } else {
                        $formattedSizeClass = 'mw-plusminus-neg';
                }
 
@@ -441,6 +443,7 @@ class ChangesList extends ContextSource {
 
        /**
         * Returns the string which indicates the number of watching users
+        * @param int $count Number of user watching a page
         * @return string
         */
        protected function numberofWatchingusers( $count ) {
@@ -459,9 +462,9 @@ class ChangesList extends ContextSource {
 
        /**
         * Determine if said field of a revision is hidden
-        * @param $rc RCCacheEntry
-        * @param $field Integer: one of DELETED_* bitfield constants
-        * @return Boolean
+        * @param RCCacheEntry|RecentChange $rc
+        * @param int $field One of DELETED_* bitfield constants
+        * @return bool
         */
        public static function isDeleted( $rc, $field ) {
                return ( $rc->mAttribs['rc_deleted'] & $field ) == $field;
@@ -470,10 +473,10 @@ class ChangesList extends ContextSource {
        /**
         * Determine if the current user is allowed to view a particular
         * field of this revision, if it's marked as deleted.
-        * @param $rc RCCacheEntry
-        * @param $field Integer
-        * @param $user User object to check, or null to use $wgUser
-        * @return Boolean
+        * @param RCCacheEntry|RecentChange $rc
+        * @param int $field
+        * @param User $user User object to check, or null to use $wgUser
+        * @return bool
         */
        public static function userCan( $rc, $field, User $user = null ) {
                if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
index bcdb33e..56630a6 100644 (file)
  * @file
  */
 class OldChangesList extends ChangesList {
-
        /**
         * Format a line using the old system (aka without any javascript).
         *
-        * @param $rc RecentChange, passed by reference
+        * @param RecentChange $rc Passed by reference
         * @param bool $watched (default false)
         * @param int $linenumber (default null)
         *
index d153212..8fba6a7 100644 (file)
@@ -101,6 +101,7 @@ class RecentChange {
        }
 
        /**
+        * No uses left in Gerrit on 2013-11-19.
         * @deprecated in 1.22
         * @param $row
         * @return RecentChange
@@ -320,7 +321,7 @@ class RecentChange {
                        'add_interwiki_prefix' => $wgRC2UDPInterwikiPrefix,
                );
 
-               return $engine->send( $feed, $line );
+               $engine->send( $feed, $line );
        }
 
        /**
@@ -347,6 +348,7 @@ class RecentChange {
                                continue;
                        }
 
+                       /** @var $formatter RCFeedFormatter */
                        $formatter = new $feed['formatter']();
                        $line = $formatter->getLine( $feed, $this, $actionComment );
 
@@ -357,7 +359,8 @@ class RecentChange {
        /**
         * Gets the stream engine object for a given URI from $wgRCEngines
         *
-        * @param $uri string URI to get the engine object for
+        * @param string $uri URI to get the engine object for
+        * @throws MWException
         * @return object The engine object
         */
        private static function getEngine( $uri ) {
index 1fe9819..f4c6f51 100644 (file)
@@ -735,6 +735,11 @@ class ContribsPager extends ReverseChronologicalPager {
                # Get the current user name for accounts
                $join_cond['user'] = Revision::userJoinCond();
 
+               $options = array();
+               if ( $index ) {
+                       $options['USE INDEX'] = array( 'revision' => $index );
+               }
+
                $queryInfo = array(
                        'tables' => $tables,
                        'fields' => array_merge(
@@ -744,7 +749,7 @@ class ContribsPager extends ReverseChronologicalPager {
                                        'page_latest', 'page_is_redirect', 'page_len' )
                        ),
                        'conds' => $conds,
-                       'options' => array( 'USE INDEX' => array( 'revision' => $index ) ),
+                       'options' => $options,
                        'join_conds' => $join_cond
                );
 
@@ -766,10 +771,10 @@ class ContribsPager extends ReverseChronologicalPager {
                $condition = array();
                $join_conds = array();
                $tables = array( 'revision', 'page', 'user' );
+               $index = false;
                if ( $this->contribs == 'newbie' ) {
                        $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ );
                        $condition[] = 'rev_user >' . (int)( $max - $max / 100 );
-                       $index = 'user_timestamp';
                        # ignore local groups with the bot right
                        # @todo FIXME: Global groups may have 'bot' rights
                        $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
index f5cd2d6..31714a6 100644 (file)
@@ -637,9 +637,6 @@ return array(
                        'user.tokens',
                ),
        ),
-       'mediawiki.icon' => array(
-               'styles' => 'resources/mediawiki/mediawiki.icon.css',
-       ),
        'mediawiki.debug' => array(
                'scripts' => 'resources/mediawiki/mediawiki.debug.js',
                'styles' => 'resources/mediawiki/mediawiki.debug.css',
@@ -653,14 +650,6 @@ return array(
                // must be loaded on the bottom
                'position' => 'bottom',
        ),
-       'mediawiki.inspect' => array(
-               'scripts' => 'resources/mediawiki/mediawiki.inspect.js',
-               'dependencies' => array(
-                       'jquery.byteLength',
-                       'jquery.json',
-               ),
-               'targets' => array( 'desktop', 'mobile' ),
-       ),
        'mediawiki.feedback' => array(
                'scripts' => 'resources/mediawiki/mediawiki.feedback.js',
                'styles' => 'resources/mediawiki/mediawiki.feedback.css',
@@ -704,6 +693,17 @@ return array(
                'scripts' => 'resources/mediawiki/mediawiki.htmlform.js',
                'messages' => array( 'htmlform-chosen-placeholder' ),
        ),
+       'mediawiki.icon' => array(
+               'styles' => 'resources/mediawiki/mediawiki.icon.css',
+       ),
+       'mediawiki.inspect' => array(
+               'scripts' => 'resources/mediawiki/mediawiki.inspect.js',
+               'dependencies' => array(
+                       'jquery.byteLength',
+                       'jquery.json',
+               ),
+               'targets' => array( 'desktop', 'mobile' ),
+       ),
        'mediawiki.notification' => array(
                'styles' => 'resources/mediawiki/mediawiki.notification.css',
                'scripts' => 'resources/mediawiki/mediawiki.notification.js',