File tree Expand file tree Collapse file tree 1 file changed +34
-8
lines changed Expand file tree Collapse file tree 1 file changed +34
-8
lines changed Original file line number Diff line number Diff line change 10
10
***************************************************************************/
11
11
12
12
/**
13
- * Memcached-based cache with read-only access.
13
+ * Cache with read-only access.
14
14
*
15
15
* @ingroup Cache
16
16
**/
17
- final class ReadOnlyPeer extends PeclMemcached
17
+ final class ReadOnlyPeer extends CachePeer
18
18
{
19
+ /**
20
+ * @var CachePeer
21
+ */
22
+ private $ innerPeer = null ;
23
+
19
24
/**
20
25
* @return ReadOnlyPeer
21
26
*/
22
- public static function create (
23
- $ host = Memcached::DEFAULT_HOST ,
24
- $ port = Memcached::DEFAULT_PORT ,
25
- $ buffer = Memcached::DEFAULT_BUFFER
26
- )
27
+ public static function create (CachePeer $ peer )
28
+ {
29
+ return new ReadOnlyPeer ($ peer );
30
+ }
31
+
32
+ public function __construct (CachePeer $ peer )
33
+ {
34
+ $ this ->innerPeer = $ peer ;
35
+ }
36
+
37
+ public function isAlive ()
38
+ {
39
+ return $ this ->innerPeer ->isAlive ();
40
+ }
41
+
42
+ public function mark ($ className )
43
+ {
44
+ return $ this ->innerPeer ->mark ($ className );
45
+ }
46
+
47
+ public function get ($ key )
48
+ {
49
+ return $ this ->innerPeer ->get ($ key );
50
+ }
51
+
52
+ public function getList ($ indexes )
27
53
{
28
- return new ReadOnlyPeer ( $ host , $ port , $ buffer );
54
+ return $ this -> innerPeer -> getList ( $ indexes );
29
55
}
30
56
31
57
public function clean ()
You can’t perform that action at this time.
0 commit comments