* @since 1.20
*/
interface ICacheHelper {
-
/**
* Sets if the cache should be enabled or not.
*
* @param integer $cacheExpiry
*/
function setExpiry( $cacheExpiry );
-
}
/**
* @since 1.20
*/
class CacheHelper implements ICacheHelper {
-
/**
* The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
*
$itemKey = array_shift( $itemKey );
if ( !is_integer( $itemKey ) ) {
- wfWarn( "Attempted to get item with non-numeric key while the next item in the queue has a key ($itemKey) in " . __METHOD__ );
+ wfWarn( "Attempted to get item with non-numeric key while " .
+ "the next item in the queue has a key ($itemKey) in " . __METHOD__ );
} elseif ( is_null( $itemKey ) ) {
wfWarn( "Attempted to get an item while the queue is empty in " . __METHOD__ );
} else {
*/
public function saveCache() {
if ( $this->cacheEnabled && $this->hasCached === false && !empty( $this->cachedChunks ) ) {
- wfGetCache( CACHE_ANYTHING )->set( $this->getCacheKeyString(), $this->cachedChunks, $this->cacheExpiry );
+ wfGetCache( CACHE_ANYTHING )->set(
+ $this->getCacheKeyString(),
+ $this->cachedChunks,
+ $this->cacheExpiry
+ );
}
}
public function setOnInitializedHandler( $handlerFunction ) {
$this->onInitHandler = $handlerFunction;
}
-
}