https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114172
Revision: 114172
Author: jeroendedauw
Date: 2012-03-19 19:24:04 +0000 (Mon, 19 Mar 2012)
Log Message:
-----------
update docs
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialCachedPage.php
Modified: trunk/phase3/includes/specials/SpecialCachedPage.php
===================================================================
--- trunk/phase3/includes/specials/SpecialCachedPage.php 2012-03-19
19:05:40 UTC (rev 114171)
+++ trunk/phase3/includes/specials/SpecialCachedPage.php 2012-03-19
19:24:04 UTC (rev 114172)
@@ -3,12 +3,13 @@
/**
* Abstract special page class with scaffolding for caching the HTML output.
*
- * To enable the caching functionality, the cacheExpiry field should be set
- * before parent::execute is called (and it should be called from execute).
- *
* To add HTML that should be cached, use addCachedHTML like this:
- * $this->addCachedHTML( array( $this, 'displayCachedContent' ) );
+ * $this->addCachedHTML( $callback );
*
+ * The callback function is only called when needed, so do all your expensive
+ * computations here. This function should returns the HTML to be cached.
+ * It should not add anything to the PageOutput object!
+ *
* Before the first addCachedHTML call, you should call $this->startCache();
* After adding the last HTML that should be cached, call $this->saveCache();
*
@@ -144,6 +145,11 @@
}
}
+ /**
+ * Gets called after the cache got initialized.
+ *
+ * @since 1.20
+ */
protected function onCacheInitialized() {
if ( $this->hasCached ) {
$this->getOutput()->setSubtitle(
$this->getCachedNotice() );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs