Elgg
Version 1.11
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Cache
MemoryPool.php
Go to the documentation of this file.
1
<?php
2
namespace
Elgg\Cache
;
3
4
use
Stash
;
5
19
final
class
MemoryPool
implements
Pool
{
23
private
$values = array();
24
26
public
function
get
(
$key
, callable $callback) {
27
assert(is_string(
$key
) || is_int(
$key
));
28
29
if
(!array_key_exists(
$key
, $this->values)) {
30
$this->values[
$key
] = call_user_func($callback);
31
}
32
return
$this->values[
$key
];
33
}
34
36
public
function
invalidate
(
$key
) {
37
assert(is_string(
$key
) || is_int(
$key
));
38
39
unset($this->values[
$key
]);
40
}
41
43
public
function
put
(
$key
,
$value
) {
44
assert(is_string(
$key
) || is_int(
$key
));
45
46
$this->values[
$key
] =
$value
;
47
}
48
}
$value
$value
Definition:
longtext.php:26
Stash
Elgg\Cache\MemoryPool\invalidate
invalidate($key)
Definition:
MemoryPool.php:36
$key
$key
Definition:
summary.php:34
Elgg\Cache\MemoryPool\put
put($key, $value)
Definition:
MemoryPool.php:43
Elgg\Cache\MemoryPool
Definition:
MemoryPool.php:19
Elgg\Cache
Definition:
LRUCache.php:2
Elgg\Cache\Pool
Definition:
Pool.php:19
Generated on Thu Oct 31 2024 00:04:39 for Elgg by
1.8.11