Deprecate "Avoid page_touched update for HTTP GET action=purge requests"
[lhc/web/wiklou.git] / includes / page / ImageHistoryPseudoPager.php
index 6ab3ffc..4785ef1 100644 (file)
@@ -31,10 +31,28 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
         */
        protected $mTitle;
 
+       /**
+        * @since 1.14
+        * @var ImagePage
+        */
+       public $mImagePage;
+
+       /**
+        * @since 1.14
+        * @var File[]
+        */
+       public $mHist;
+
+       /**
+        * @since 1.14
+        * @var int[]
+        */
+       public $mRange;
+
        /**
         * @param ImagePage $imagePage
         */
-       function __construct( $imagePage ) {
+       public function __construct( $imagePage ) {
                parent::__construct( $imagePage->getContext() );
                $this->mImagePage = $imagePage;
                $this->mTitle = clone $imagePage->getTitle();
@@ -42,23 +60,29 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $this->mImg = null;
                $this->mHist = [];
                $this->mRange = [ 0, 0 ]; // display range
+
+               // Only display 10 revisions at once by default, otherwise the list is overwhelming
+               $this->mLimitsShown = array_merge( [ 10 ], $this->mLimitsShown );
+               $this->mDefaultLimit = 10;
+               list( $this->mLimit, /* $offset */ ) =
+                       $this->mRequest->getLimitOffset( $this->mDefaultLimit, '' );
        }
 
        /**
         * @return Title
         */
-       function getTitle() {
+       public function getTitle() {
                return $this->mTitle;
        }
 
-       function getQueryInfo() {
+       public function getQueryInfo() {
                return false;
        }
 
        /**
         * @return string
         */
-       function getIndexField() {
+       public function getIndexField() {
                return '';
        }
 
@@ -66,14 +90,14 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
         * @param object $row
         * @return string
         */
-       function formatRow( $row ) {
+       public function formatRow( $row ) {
                return '';
        }
 
        /**
         * @return string
         */
-       function getBody() {
+       public function getBody() {
                $s = '';
                $this->doQuery();
                if ( count( $this->mHist ) ) {
@@ -107,7 +131,7 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                return $s;
        }
 
-       function doQuery() {
+       public function doQuery() {
                if ( $this->mQueryDone ) {
                        return;
                }