* Follow-up to
7730dee6.
* Let subclasses avoid having to check $wgMiserMode themselves.
* Use the Config object instead of global variables.
Change-Id: Ic48f5f5a7ed8e1d04b13922375fb7873adfa0c60
* false to use the parent page's cache settings
*/
public function maxIncludeCacheTime() {
- global $wgMiserMode;
- if ( !$wgMiserMode ) {
- return 0;
- } else {
- return 60*60;
- }
+ return $this->getConfig()->get( 'MiserMode' ) ? $this->getCacheTTL() : 0;
+ }
+
+ /**
+ * @return int Seconds that this page can be cached
+ */
+ protected function getCacheTTL() {
+ return 60 * 60;
}
/**
return 'changes';
}
- /**
- * How long to cache page when it is being included.
- *
- * @return int Time in seconds, 0 to disable caching altogether
- */
- public function maxIncludeCacheTime() {
- global $wgMiserMode;
- if ( !$wgMiserMode ) {
- return 0;
- } else {
- return 60*5;
- }
+ protected function getCacheTTL() {
+ return 60 * 5;
}
}
return true;
}
- /**
- * How long to cache page when it is being included.
- *
- * @return int|bool Time in seconds, 0 to disable caching altogether
- */
- public function maxIncludeCacheTime() {
- global $wgMiserMode;
- if ( !$wgMiserMode ) {
- return 0;
- } else {
- return 60*5;
- }
+ protected function getCacheTTL() {
+ return 60 * 50;
}
}