56 foreach ( $this->deps as $dep ) {
57 if ( $dep->isExpired() ) {
70 foreach ( $this->deps as $dep ) {
71 $dep->loadDependencyValues();
92 $cache->set( $key, $this, $expiry );
113 $callbackParams = [],
$deps = []
115 $obj =
$cache->get( $key );
120 $value = $callback( ...$callbackParams );
121 # Cache the newly-generated value
123 $wrapper->storeToCache(
$cache, $key, $expiry );
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
This class stores an arbitrary value along with its dependencies.
__construct( $value=false, $deps=[])
initialiseDeps()
Initialise dependency values in preparation for storing.
static getValueFromCache( $cache, $key, $expiry=0, $callback=false, $callbackParams=[], $deps=[])
Attempt to get a value from the cache.
storeToCache( $cache, $key, $expiry=0)
Store the wrapper to a cache.
getValue()
Get the user-defined value.
isExpired()
Returns true if any of the dependencies have expired.