58 throw new InvalidArgumentException(
59 'Argument 1 passed to MemoizedCallable::__construct() must ' .
64 if ( $this->callableName ===
'Closure::__invoke' ) {
66 $this->callableName .=
uniqid();
70 $this->ttl = min(
max( $ttl, 1 ), 86400 );
112 foreach (
$args as $arg ) {
113 if ( $arg !==
null && !
is_scalar( $arg ) ) {
114 throw new InvalidArgumentException(
115 'MemoizedCallable::invoke() called with non-scalar ' .
122 $key = __CLASS__ .
':' . $this->callableName .
':' . $hash;
156 return $instance->invokeArgs(
$args );
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
APC-backed and APCu-backed function memoization.
invoke()
Invoke the memoized function or method.
static call( $callable, array $args=[], $ttl=3600)
Shortcut method for creating a MemoizedCallable and invoking it with the specified arguments.
__construct( $callable, $ttl=3600)
fetchResult( $key, &$success)
Fetch the result of a previous invocation from APC or APCu.
string $callableName
Unique name of callable; used for cache keys.
invokeArgs(array $args=[])
Invoke the memoized function or method.
storeResult( $key, $result)
Store the result of an invocation in APC or APCu.
namespace being checked & $result
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))