*/
class CategoryViewer extends ContextSource {
- var $limit, $from, $until,
- $articles, $articles_start_char,
- $children, $children_start_char,
- $showGallery, $imgsNoGalley,
- $imgsNoGallery_start_char,
- $imgsNoGallery;
+ /** @var int */
+ public $limit;
- /**
- * @var Array
- */
- var $nextPage;
+ /** @var array */
+ protected $from;
- /**
- * @var Array
- */
- var $flip;
+ /** @var array */
+ protected $until;
- /**
- * @var Title
- */
- var $title;
+ /** @var string[] */
+ public $articles;
- /**
- * @var Collation
- */
- var $collation;
+ /** @var array */
+ public $articles_start_char;
- /**
- * @var ImageGallery
- */
- var $gallery;
+ /** @var array */
+ protected $children;
- /**
- * Category object for this page
- * @var Category
- */
+ /** @var array */
+ protected $children_start_char;
+
+ /** @var bool */
+ protected $showGallery;
+
+ /** @var array */
+ protected $imgsNoGallery_start_char;
+
+ /** @var array */
+ protected $imgsNoGallery;
+
+ /** @var array */
+ protected $nextPage;
+
+ /** @var array */
+ protected $flip;
+
+ /** @var Title */
+ protected $title;
+
+ /** @var Collation */
+ protected $collation;
+
+ /** @var ImageGallery */
+ protected $gallery;
+
+ /** @var Category Category object for this page. */
private $cat;
- /**
- * The original query array, to be used in generating paging links.
- * @var array
- */
+ /** @var array The original query array, to be used in generating paging links. */
private $query;
/**
- * Constructor
- *
* @since 1.19 $context is a second, required parameter
- * @param $title Title
- * @param $context IContextSource
+ * @param Title $title
+ * @param IContextSource $context
* @param array $from An array with keys page, subcat,
* and file for offset of results of each section (since 1.17)
* @param array $until An array with 3 keys for until of each section (since 1.17)
- * @param $query Array
+ * @param array $query
*/
function __construct( $title, IContextSource $context, $from = array(),
$until = array(), $query = array()
/**
* Add a subcategory to the internal lists, using a Category object
- * @param $cat Category
- * @param $sortkey
- * @param $pageLength
+ * @param Category $cat
+ * @param string $sortkey
+ * @param int $pageLength
*/
function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
// Subcategory; strip the 'Category' namespace from the link text.
/**
* Add a page in the image namespace
- * @param $title Title
- * @param $sortkey
- * @param $pageLength
- * @param $isRedirect bool
+ * @param Title $title
+ * @param string $sortkey
+ * @param int $pageLength
+ * @param bool $isRedirect
*/
function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
/**
* Add a miscellaneous page
- * @param $title
- * @param $sortkey
- * @param $pageLength
- * @param $isRedirect bool
+ * @param Title $title
+ * @param string $sortkey
+ * @param int $pageLength
+ * @param bool $isRedirect
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
* Format a list of articles chunked by letter, either as a
* bullet list or a columnar format, depending on the length.
*
- * @param $articles Array
- * @param $articles_start_char Array
- * @param $cutoff Int
- * @return String
+ * @param array $articles
+ * @param array $articles_start_char
+ * @param int $cutoff
+ * @return string
* @private
*/
function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
* More distant TODO: Scrap this and use CSS columns, whenever IE finally
* supports those.
*
- * @param $articles Array
- * @param $articles_start_char Array
- * @return String
+ * @param array $articles
+ * @param string[] $articles_start_char
+ * @return string
* @private
*/
static function columnList( $articles, $articles_start_char ) {
/**
* Format a list of articles chunked by letter in a bullet list.
- * @param $articles Array
- * @param $articles_start_char Array
- * @return String
+ * @param array $articles
+ * @param string[] $articles_start_char
+ * @return string
* @private
*/
static function shortList( $articles, $articles_start_char ) {
* @param string $last The 'from' parameter for the generated URL
* @param string $type A prefix for parameters, 'page' or 'subcat' or
* 'file'
- * @return String HTML
+ * @return string HTML
*/
private function pagingLinks( $first, $last, $type = '' ) {
$prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped();
// to refresh the incorrect category table entry -- which should be
// quick due to the small number of entries.
$totalcnt = $rescnt;
- $this->cat->refreshCounts();
+ $category = $this->cat;
+ wfGetDB( DB_MASTER )->onTransactionIdle( function() use ( $category ) {
+ $category->refreshCounts();
+ } );
} else {
// Case 3: hopeless. Don't give a total count at all.
// Messages: category-subcat-count-limited, category-article-count-limited,