117 if (
is_null( $this->hasCached ) ) {
142 if ( $this->cacheExpiry < 86400 * 3650 ) {
144 'cachedspecial-viewing-cached-ttl',
145 $context->getLanguage()->formatDuration( $this->cacheExpiry )
149 'cachedspecial-viewing-cached-ts'
153 if ( $includePurgeLink ) {
154 $refreshArgs =
$context->getRequest()->getQueryValues();
155 unset( $refreshArgs[
'title'] );
156 $refreshArgs[
'action'] =
'purge';
158 $subPage =
$context->getTitle()->getFullText();
159 $subPage = explode(
'/', $subPage, 2 );
160 $subPage = count( $subPage ) > 1 ? $subPage[1] :
false;
162 $message .=
' ' . MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
164 $context->msg(
'cachedspecial-refresh-now' )->text(),
180 if ( $this->cacheEnabled &&
is_null( $this->hasCached ) ) {
186 if ( $this->onInitHandler !==
false ) {
209 if ( $this->cacheEnabled && $this->hasCached ) {
213 reset( $this->cachedChunks );
214 $itemKey =
key( $this->cachedChunks );
216 if ( !
is_int( $itemKey ) ) {
217 wfWarn(
"Attempted to get item with non-numeric key while " .
218 "the next item in the queue has a key ($itemKey) in " . __METHOD__ );
220 wfWarn(
"Attempted to get an item while the queue is empty in " . __METHOD__ );
225 $value = $this->cachedChunks[$key];
226 unset( $this->cachedChunks[$key] );
228 wfWarn(
"There is no item with key '$key' in this->cachedChunks in " . __METHOD__ );
237 if ( $this->cacheEnabled ) {
239 $this->cachedChunks[] =
$value;
241 $this->cachedChunks[$key] =
$value;
256 if ( $this->cacheEnabled && $this->hasCached ===
false && !empty( $this->cachedChunks ) ) {
287 if ( $this->cacheKey === [] ) {
288 throw new MWException(
'No cache key set, so cannot obtain or save the CacheHelper values.' );
313 $this->hasCached =
false;
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
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfGetCache( $cacheType)
Get a specific cache object.
wfMemcKey(... $args)
Make a cache key for the local wiki.
Helper class for caching various elements in a single cache entry.
bool $cacheEnabled
If the cache is enabled or not.
saveCache()
Saves the HTML to the cache in case it got recomputed.
setOnInitializedHandler( $handlerFunction)
Sets a function that gets called when initialization of the cache is done.
array $cacheKey
Elements to build a cache key with.
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....
callable $onInitHandler
Function that gets called when initialization is done.
startCache( $cacheExpiry=null, $cacheEnabled=null)
Initializes the caching.
getCacheKeyString()
Returns the cache key to use to cache this page's HTML output.
bool null $hasCached
Indicates if the to be cached content was already cached.
setCacheEnabled( $cacheEnabled)
Sets if the cache should be enabled or not.
setCacheKey(array $cacheKey)
Sets the cache key that should be used.
array $cachedChunks
List of HTML chunks to be cached (if !hasCached) or that where cached (of hasCached).
rebuildOnDemand()
Rebuild the content, even if it's already cached.
getCachedNotice(IContextSource $context, $includePurgeLink=true)
Returns a message that notifies the user he/she is looking at a cached version of the page,...
initCaching()
Initializes the caching if not already done so.
int $cacheExpiry
The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message key
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Interface for all classes implementing CacheHelper functionality.
Interface for objects which can provide a MediaWiki context on request.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))