Index: trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php |
— | — | @@ -23,8 +23,6 @@ |
24 | 24 | $this->cacheExpiry = 600; |
25 | 25 | } |
26 | 26 | |
27 | | - protected $cachedOut; |
28 | | - |
29 | 27 | /** |
30 | 28 | * Main method. |
31 | 29 | * |
Index: trunk/extensions/EducationProgram/specials/SpecialCachedPage.php |
— | — | @@ -21,8 +21,23 @@ |
22 | 22 | */ |
23 | 23 | protected $cacheExpiry = 300; |
24 | 24 | |
| 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 | + */ |
25 | 33 | protected $cachedChunks; |
26 | 34 | |
| 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 | + */ |
27 | 42 | protected $hasCached = null; |
28 | 43 | |
29 | 44 | /** |
— | — | @@ -119,7 +134,7 @@ |
120 | 135 | * @since 0.1 |
121 | 136 | */ |
122 | 137 | public function saveCache() { |
123 | | - if ( !$this->hasCached && !empty( $this->cachedChunks ) ) { |
| 138 | + if ( $this->hasCached === false && !empty( $this->cachedChunks ) ) { |
124 | 139 | wfGetCache( CACHE_ANYTHING )->set( $this->getCacheKey(), $this->cachedChunks, $this->cacheExpiry ); |
125 | 140 | } |
126 | 141 | } |