* (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
// 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;
*/
$wgEnableOpenSearchSuggest = true;
+/**
+ * Integer defining default number of entries to show on
+ * OpenSearch call.
+ */
+$wgOpenSearchDefaultLimit = 10;
+
/**
* Expiry time for search suggestion responses
*/
* @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
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();
}
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,
/**
* 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.
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 ) {
* 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();
* 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 = ' ' ) {
global $wgRecentChangesFlags;
* "!" 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;
/**
* Returns text for the start of the tabular part of RC
- * @return String
+ * @return string
*/
public function beginRecentChangesList() {
$this->rc_cache = array();
/**
* 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;
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';
}
/**
* 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 ) {
/**
* 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;
/**
* 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 ) {
* @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)
*
}
/**
+ * No uses left in Gerrit on 2013-11-19.
* @deprecated in 1.22
* @param $row
* @return RecentChange
'add_interwiki_prefix' => $wgRC2UDPInterwikiPrefix,
);
- return $engine->send( $feed, $line );
+ $engine->send( $feed, $line );
}
/**
continue;
}
+ /** @var $formatter RCFeedFormatter */
$formatter = new $feed['formatter']();
$line = $formatter->getLine( $feed, $this, $actionComment );
/**
* 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 ) {
# 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(
'page_latest', 'page_is_redirect', 'page_len' )
),
'conds' => $conds,
- 'options' => array( 'USE INDEX' => array( 'revision' => $index ) ),
+ 'options' => $options,
'join_conds' => $join_cond
);
$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' );
'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',
// 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',
'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',