Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Cache
Pool
InMemory.php
Go to the documentation of this file.
1
<?php
2
namespace
Elgg\Cache\Pool
;
3
4
use
Elgg\Cache\Pool
;
5
use
Stash
;
6
18
final
class
InMemory
implements
Pool
{
22
private
$values = array();
23
25
public
function
get
(
$key
, callable $callback = null,
$default
= null) {
26
assert(is_string(
$key
) || is_int(
$key
));
27
28
if
(!array_key_exists(
$key
, $this->values)) {
29
if
(!$callback) {
30
return
$default
;
31
}
32
$this->values[
$key
] = call_user_func($callback);
33
}
34
return
$this->values[
$key
];
35
}
36
38
public
function
invalidate
(
$key
) {
39
assert(is_string(
$key
) || is_int(
$key
));
40
41
unset($this->values[
$key
]);
42
}
43
45
public
function
put
(
$key
,
$value
) {
46
assert(is_string(
$key
) || is_int(
$key
));
47
48
$this->values[
$key
] =
$value
;
49
}
50
}
Elgg\Cache\Pool\InMemory\invalidate
invalidate($key)
Definition:
InMemory.php:38
$value
$value
Definition:
longtext.php:42
Stash
$default
$default
Definition:
checkbox.php:34
$key
$key
Definition:
summary.php:34
Elgg\Cache\Pool\InMemory
An in-memory implementation of a cache pool.
Definition:
InMemory.php:18
Elgg\Cache\Pool
Definition:
Pool.php:19
Elgg\Cache\Pool\InMemory\put
put($key, $value)
Definition:
InMemory.php:45
use
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition:
MIT-LICENSE.txt:5
Elgg\Cache\Pool
Definition:
InMemory.php:2
Generated on Sat Dec 21 2024 00:01:03 for Elgg by
1.8.11