https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114046
Revision: 114046
Author: jeroendedauw
Date: 2012-03-17 01:36:29 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
Follow up to r114045; cleanup + docs
Modified Paths:
--------------
trunk/extensions/EducationProgram/specials/SpecialCachedPage.php
trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php
Modified: trunk/extensions/EducationProgram/specials/SpecialCachedPage.php
===================================================================
--- trunk/extensions/EducationProgram/specials/SpecialCachedPage.php
2012-03-17 01:23:53 UTC (rev 114045)
+++ trunk/extensions/EducationProgram/specials/SpecialCachedPage.php
2012-03-17 01:36:29 UTC (rev 114046)
@@ -21,8 +21,23 @@
*/
protected $cacheExpiry = 300;
+ /**
+ * List of HTML chunks to be cached (if !hasCached) or that where
cashed (of hasCached).
+ * If no cached already, then the newly computed chunks are added here,
+ * if it as cached already, chunks are removed from this list as they
are needed.
+ *
+ * @since 0.1
+ * @var array
+ */
protected $cachedChunks;
+ /**
+ * Indicates if the to be cached content was already cached.
+ * Null if this information is not available yet.
+ *
+ * @since 0.1
+ * @var boolean|null
+ */
protected $hasCached = null;
/**
@@ -119,7 +134,7 @@
* @since 0.1
*/
public function saveCache() {
- if ( !$this->hasCached && !empty( $this->cachedChunks ) ) {
+ if ( $this->hasCached === false && !empty( $this->cachedChunks
) ) {
wfGetCache( CACHE_ANYTHING )->set(
$this->getCacheKey(), $this->cachedChunks, $this->cacheExpiry );
}
}
Modified: trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php
===================================================================
--- trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php
2012-03-17 01:23:53 UTC (rev 114045)
+++ trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php
2012-03-17 01:36:29 UTC (rev 114046)
@@ -23,8 +23,6 @@
$this->cacheExpiry = 600;
}
- protected $cachedOut;
-
/**
* Main method.
*
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs