87 $this->cacheHelper->setCacheEnabled( $this->cacheEnabled );
88 $this->cacheHelper->setOnInitializedHandler( [ $this,
'onCacheInitialized' ] );
92 if (
array_key_exists(
'action', $keyArgs ) && $keyArgs[
'action'] ===
'purge' ) {
93 unset( $keyArgs[
'action'] );
96 $this->cacheHelper->setCacheKey( $keyArgs );
98 if ( $this->
getRequest()->getText(
'action' ) ===
'purge' ) {
99 $this->cacheHelper->rebuildOnDemand();
102 $this->cacheHelper->startCache( $cacheExpiry,
$cacheEnabled );
120 return $this->cacheHelper->getCachedValue( $computeFunction,
$args, $key );
136 $html = $this->cacheHelper->getCachedValue( $computeFunction,
$args, $key );
147 $this->cacheHelper->saveCache();
159 $this->cacheHelper->setExpiry( $cacheExpiry );
186 $this->
getOutput()->setSubtitle( $this->cacheHelper->getCachedNotice( $this->getContext() ) );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
getName()
Return the name of the action this object responds to.
getOutput()
Get the OutputPage being used for this instance.
getLanguage()
Shortcut to get the user Language being used for this instance.
getRequest()
Get the WebRequest being used for this instance.
Helper class for caching various elements in a single cache entry.
Abstract action class with scaffolding for caching HTML and other values in a single blob.
CacheHelper $cacheHelper
CacheHelper object to which we forward the non-SpecialPage specific caching work.
addCachedHTML( $computeFunction, $args=[], $key=null)
Add some HTML to be cached.
setCacheEnabled( $cacheEnabled)
Sets if the cache should be enabled or not.
saveCache()
Saves the HTML to the cache in case it got recomputed.
startCache( $cacheExpiry=null, $cacheEnabled=null)
Initializes the caching.
bool $cacheEnabled
If the cache is enabled or not.
onCacheInitialized( $hasCached)
Gets called after the cache got initialized.
getCachedValue( $computeFunction, $args=[], $key=null)
Get a cached value if available or compute it if not and then cache it if possible.
setExpiry( $cacheExpiry)
Sets the time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
getCacheKey()
Returns the variables used to constructed the cache key in an array.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Interface for all classes implementing CacheHelper functionality.