[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/cache/ -> CacheDependency.php (summary)

Data caching with dependencies. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 265 lines (6 kb)
Included or required:0 times
Referenced: 5 times
Includes or requires: 0 files

Defines 4 classes

DependencyWrapper:: (7 methods):
  __construct()
  isExpired()
  initialiseDeps()
  getValue()
  storeToCache()
  getValueFromCache()
  loadDependencyValues()

FileDependency:: (4 methods):
  __construct()
  __sleep()
  loadDependencyValues()
  isExpired()

GlobalDependency:: (2 methods):
  __construct()
  isExpired()

ConstantDependency:: (2 methods):
  __construct()
  isExpired()


Class: DependencyWrapper  - X-Ref

This class stores an arbitrary value along with its dependencies.
Users should typically only use DependencyWrapper::getValueFromCache(),
rather than instantiating one of these objects directly.

__construct( $value = false, $deps = array()   X-Ref
Create an instance.

param: mixed $value The user-supplied value
param: CacheDependency|CacheDependency[] $deps A dependency or dependency

isExpired()   X-Ref
Returns true if any of the dependencies have expired

return: bool

initialiseDeps()   X-Ref
Initialise dependency values in preparation for storing. This must be
called before serialization.


getValue()   X-Ref
Get the user-defined value

return: bool|mixed

storeToCache( $cache, $key, $expiry = 0 )   X-Ref
Store the wrapper to a cache

param: BagOStuff $cache
param: string $key
param: int $expiry

getValueFromCache( $cache, $key, $expiry = 0, $callback = false,$callbackParams = array()   X-Ref
Attempt to get a value from the cache. If the value is expired or missing,
it will be generated with the callback function (if present), and the newly
calculated value will be stored to the cache in a wrapper.

param: BagOStuff $cache A cache object such as $wgMemc
param: string $key The cache key
param: int $expiry The expiry timestamp or interval in seconds
param: bool|callable $callback The callback for generating the value, or false
param: array $callbackParams The function parameters for the callback
param: array $deps The dependencies to store on a cache miss. Note: these
return: mixed The value, or null if it was not present in the cache and no

loadDependencyValues()   X-Ref
Hook to perform any expensive pre-serialize loading of dependency values.


Class: FileDependency  - X-Ref


__construct( $filename, $timestamp = null )   X-Ref
Create a file dependency

param: string $filename The name of the file, preferably fully qualified
param: null|bool|int $timestamp The unix last modified timestamp, or false if the

__sleep()   X-Ref

return: array

loadDependencyValues()   X-Ref
No description

isExpired()   X-Ref

return: bool

Class: GlobalDependency  - X-Ref


__construct( $name )   X-Ref
No description

isExpired()   X-Ref

return: bool

Class: ConstantDependency  - X-Ref


__construct( $name )   X-Ref
No description

isExpired()   X-Ref

return: bool



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1