Go to the documentation of this file.
44 if ( !is_array(
$deps ) ) {
57 foreach ( $this->deps
as $dep ) {
58 if ( $dep->isExpired() ) {
71 foreach ( $this->deps
as $dep ) {
72 $dep->loadDependencyValues();
93 $cache->set( $key, $this, $expiry );
116 $obj =
$cache->get( $key );
120 } elseif ( $callback ) {
121 $value = call_user_func_array( $callback, $callbackParams );
122 # Cache the newly-generated value
124 $wrapper->storeToCache(
$cache, $key, $expiry );
179 return array(
'filename',
'timestamp' );
183 if ( is_null( $this->timestamp ) ) {
184 if ( !file_exists( $this->filename ) ) {
185 # Dependency on a non-existent file
186 # This is a valid concept!
187 $this->timestamp =
false;
189 $this->timestamp = filemtime( $this->filename );
198 if ( !file_exists( $this->filename ) ) {
199 if ( $this->timestamp ===
false ) {
204 wfDebug(
"Dependency triggered: {$this->filename} deleted.\n" );
209 $lastmod = filemtime( $this->filename );
210 if ( $lastmod > $this->timestamp ) {
211 # Modified or created
212 wfDebug(
"Dependency triggered: {$this->filename} changed.\n" );
256 $this->value = constant(
$name );
getValue()
Get the user-defined value.
isExpired()
Returns true if any of the dependencies have expired.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
loadDependencyValues()
Hook to perform any expensive pre-serialize loading of dependency values.
This class stores an arbitrary value along with its dependencies.
__construct( $value=false, $deps=array())
Create an instance.
storeToCache( $cache, $key, $expiry=0)
Store the wrapper to a cache.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
__construct( $filename, $timestamp=null)
Create a file dependency.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
loadDependencyValues()
Hook to perform any expensive pre-serialize loading of dependency values.
isExpired()
Returns true if the dependency is expired, false otherwise.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static getValueFromCache( $cache, $key, $expiry=0, $callback=false, $callbackParams=array(), $deps=array())
Attempt to get a value from the cache.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
initialiseDeps()
Initialise dependency values in preparation for storing.