MediaWiki REL1_32
ArrayBackedMemoizedCallable Class Reference

A MemoizedCallable subclass that stores function return values in an instance property rather than APC or APCu. More...

Inheritance diagram for ArrayBackedMemoizedCallable:
Collaboration diagram for ArrayBackedMemoizedCallable:

Protected Member Functions

 fetchResult ( $key, &$success)
 Fetch the result of a previous invocation from APC or APCu.
 
 storeResult ( $key, $result)
 Store the result of an invocation in APC or APCu.
 

Private Attributes

 $cache = []
 

Additional Inherited Members

- Public Member Functions inherited from MemoizedCallable
 __construct ( $callable, $ttl=3600)
 
 invoke ()
 Invoke the memoized function or method.
 
 invokeArgs (array $args=[])
 Invoke the memoized function or method.
 
- Static Public Member Functions inherited from MemoizedCallable
static call ( $callable, array $args=[], $ttl=3600)
 Shortcut method for creating a MemoizedCallable and invoking it with the specified arguments.
 

Detailed Description

A MemoizedCallable subclass that stores function return values in an instance property rather than APC or APCu.

Definition at line 6 of file MemoizedCallableTest.php.

Member Function Documentation

◆ fetchResult()

ArrayBackedMemoizedCallable::fetchResult (   $key,
$success 
)
protected

Fetch the result of a previous invocation from APC or APCu.

Parameters
string$key
bool&$success
Returns
bool

Reimplemented from MemoizedCallable.

Definition at line 9 of file MemoizedCallableTest.php.

References $success, and cache.

◆ storeResult()

ArrayBackedMemoizedCallable::storeResult (   $key,
  $result 
)
protected

Store the result of an invocation in APC or APCu.

Parameters
string$key
mixed$result

Reimplemented from MemoizedCallable.

Definition at line 18 of file MemoizedCallableTest.php.

References cache.

Member Data Documentation

◆ $cache

ArrayBackedMemoizedCallable::$cache = []
private

Definition at line 7 of file MemoizedCallableTest.php.


The documentation for this class was generated from the following file: