1 | <?php |
||
15 | class CompositeCache implements Cache { |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $caches = array(); |
||
21 | |||
22 | /** |
||
23 | * @note The access hierarchy is determined by the order of the invoked cache |
||
24 | * instances and it is assumed that the faster cache is accessible first. |
||
25 | * |
||
26 | * @since 1.0 |
||
27 | * |
||
28 | * @param Cache[] $caches |
||
29 | */ |
||
30 | 12 | public function __construct( array $caches ) { |
|
45 | |||
46 | /** |
||
47 | * @since 1.0 |
||
48 | * |
||
49 | * {@inheritDoc} |
||
50 | */ |
||
51 | 3 | public function fetch( $id ) { |
|
76 | |||
77 | /** |
||
78 | * @since 1.0 |
||
79 | * |
||
80 | * {@inheritDoc} |
||
81 | */ |
||
82 | 3 | public function contains( $id ) { |
|
92 | |||
93 | /** |
||
94 | * @since 1.0 |
||
95 | * |
||
96 | * {@inheritDoc} |
||
97 | */ |
||
98 | 2 | public function save( $id, $data, $ttl = 0 ) { |
|
103 | |||
104 | /** |
||
105 | * @since 1.0 |
||
106 | * |
||
107 | * {@inheritDoc} |
||
108 | */ |
||
109 | 2 | public function delete( $id ) { |
|
114 | |||
115 | /** |
||
116 | * @since 1.0 |
||
117 | * |
||
118 | * {@inheritDoc} |
||
119 | */ |
||
120 | 1 | public function getStats() { |
|
130 | |||
131 | /** |
||
132 | * @since 1.2 |
||
133 | * |
||
134 | * {@inheritDoc} |
||
135 | */ |
||
136 | 1 | public function getName() { |
|
146 | |||
147 | } |
||
148 |