1 | <?php |
||
15 | class CacheFactory { |
||
16 | |||
17 | /** |
||
18 | * @var CacheFactory |
||
19 | */ |
||
20 | private static $instance = null; |
||
21 | |||
22 | /** |
||
23 | * @since 1.0 |
||
24 | * |
||
25 | * @return CacheFactory |
||
26 | */ |
||
27 | 2 | public static function getInstance() { |
|
35 | |||
36 | /** |
||
37 | * @since 1.0 |
||
38 | */ |
||
39 | 1 | public static function clear() { |
|
42 | |||
43 | /** |
||
44 | * @since 1.0 |
||
45 | * |
||
46 | * @param BagOStuff $cache |
||
47 | * |
||
48 | * @return MediaWikiCache |
||
49 | */ |
||
50 | 2 | public function newMediaWikiCache( BagOStuff $cache ) { |
|
53 | |||
54 | /** |
||
55 | * @since 1.0 |
||
56 | * |
||
57 | * @param DoctrineCacheClient $cache |
||
58 | * |
||
59 | * @return DoctrineCache |
||
60 | */ |
||
61 | 2 | public function newDoctrineCache( DoctrineCacheClient $cache ) { |
|
64 | |||
65 | /** |
||
66 | * @since 1.1 |
||
67 | * |
||
68 | * @param integer $cacheSize |
||
69 | * |
||
70 | * @return FixedInMemoryLruCache |
||
71 | */ |
||
72 | 3 | public function newFixedInMemoryLruCache( $cacheSize = 500 ) { |
|
75 | |||
76 | /** |
||
77 | * @since 1.0 |
||
78 | * |
||
79 | * @deprecated since 1.1, use CacheFactory::newFixedInMemoryLruCache |
||
80 | */ |
||
81 | 2 | public function newFixedInMemoryCache( $cacheSize = 500 ) { |
|
82 | 2 | return $this->newFixedInMemoryLruCache( $cacheSize ); |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * @since 1.0 |
||
87 | * |
||
88 | * @param Cache[] $caches |
||
89 | * |
||
90 | * @return CompositeCache |
||
91 | */ |
||
92 | 2 | public function newCompositeCache( array $caches ) { |
|
95 | |||
96 | /** |
||
97 | * @since 1.1 |
||
98 | * |
||
99 | * @return NullCache |
||
100 | */ |
||
101 | 1 | public function newNullCache() { |
|
104 | |||
105 | /** |
||
106 | * @since 1.1 |
||
107 | * |
||
108 | * @param StorageInterface $cache |
||
109 | * |
||
110 | * @return ZendCache |
||
111 | */ |
||
112 | 1 | public function newZendCache( StorageInterface $cache ) { |
|
115 | |||
116 | } |
||
117 |