diff options
Diffstat (limited to 'includes/cache/CacheDependency.php')
-rw-r--r-- | includes/cache/CacheDependency.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/includes/cache/CacheDependency.php b/includes/cache/CacheDependency.php index aa020664..0df0cd89 100644 --- a/includes/cache/CacheDependency.php +++ b/includes/cache/CacheDependency.php @@ -28,6 +28,8 @@ class DependencyWrapper { /** * Returns true if any of the dependencies have expired + * + * @return bool */ function isExpired() { foreach ( $this->deps as $dep ) { @@ -51,6 +53,7 @@ class DependencyWrapper { /** * Get the user-defined value + * @return bool|\Mixed */ function getValue() { return $this->value; @@ -143,6 +146,9 @@ class FileDependency extends CacheDependency { $this->timestamp = $timestamp; } + /** + * @return array + */ function __sleep() { $this->loadDependencyValues(); return array( 'filename', 'timestamp' ); @@ -265,11 +271,15 @@ class TitleListDependency extends CacheDependency { /** * Construct a dependency on a list of titles + * @param $linkBatch LinkBatch */ function __construct( LinkBatch $linkBatch ) { $this->linkBatch = $linkBatch; } + /** + * @return array + */ function calculateTimestamps() { # Initialise values to false $timestamps = array(); @@ -314,6 +324,9 @@ class TitleListDependency extends CacheDependency { return array( 'timestamps' ); } + /** + * @return LinkBatch + */ function getLinkBatch() { if ( !isset( $this->linkBatch ) ) { $this->linkBatch = new LinkBatch; @@ -370,6 +383,9 @@ class GlobalDependency extends CacheDependency { * @return bool */ function isExpired() { + if( !isset($GLOBALS[$this->name]) ) { + return true; + } return $GLOBALS[$this->name] != $this->value; } } |