r114046 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114045‎ | r114046 | r114047 >
Date:01:36, 17 March 2012
Author:jeroendedauw
Status:ok
Tags:
Comment:
Follow up to r114045; cleanup + docs
Modified paths:
  • /trunk/extensions/EducationProgram/specials/SpecialCachedPage.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php
@@ -23,8 +23,6 @@
2424 $this->cacheExpiry = 600;
2525 }
2626
27 - protected $cachedOut;
28 -
2927 /**
3028 * Main method.
3129 *
Index: trunk/extensions/EducationProgram/specials/SpecialCachedPage.php
@@ -21,8 +21,23 @@
2222 */
2323 protected $cacheExpiry = 300;
2424
 25+ /**
 26+ * List of HTML chunks to be cached (if !hasCached) or that where cashed (of hasCached).
 27+ * If no cached already, then the newly computed chunks are added here,
 28+ * if it as cached already, chunks are removed from this list as they are needed.
 29+ *
 30+ * @since 0.1
 31+ * @var array
 32+ */
2533 protected $cachedChunks;
2634
 35+ /**
 36+ * Indicates if the to be cached content was already cached.
 37+ * Null if this information is not available yet.
 38+ *
 39+ * @since 0.1
 40+ * @var boolean|null
 41+ */
2742 protected $hasCached = null;
2843
2944 /**
@@ -119,7 +134,7 @@
120135 * @since 0.1
121136 */
122137 public function saveCache() {
123 - if ( !$this->hasCached && !empty( $this->cachedChunks ) ) {
 138+ if ( $this->hasCached === false && !empty( $this->cachedChunks ) ) {
124139 wfGetCache( CACHE_ANYTHING )->set( $this->getCacheKey(), $this->cachedChunks, $this->cacheExpiry );
125140 }
126141 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114045Follow up to r114044; decided upon an approach for the caching stuff and got ...jeroendedauw01:23, 17 March 2012

Status & tagging log