1 | <?php |
||
40 | class DesarrollaCacheFactory implements FactoryInterface |
||
41 | { |
||
42 | /* @const DEFAULT_TTL */ |
||
43 | const DEFAULT_TTL = 3600; |
||
44 | /* @const DEFAULT_LIMIT */ |
||
45 | const DEFAULT_LIMIT = 1000; |
||
46 | |||
47 | /* @var array */ |
||
48 | protected $config; |
||
49 | |||
50 | /** |
||
51 | * @param string|null $configFile |
||
52 | * @param array $configArray |
||
53 | */ |
||
54 | 1 | public function __construct($configFile = null, array $configArray = []) |
|
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | 1 | public function make() |
|
77 | |||
78 | /** |
||
79 | * Make the driver based on given config |
||
80 | * |
||
81 | * @return null|\Desarrolla2\Cache\Adapter\AdapterInterface |
||
82 | * |
||
83 | * @throws DriverNotFoundException |
||
84 | * @throws InvalidConfigException |
||
85 | */ |
||
86 | 1 | protected function getDriver() |
|
108 | |||
109 | /** |
||
110 | * Create NotCache driver |
||
111 | * |
||
112 | * @return NotCache |
||
113 | */ |
||
114 | 1 | protected function createNotcacheDriver() |
|
118 | |||
119 | /** |
||
120 | * Create File driver |
||
121 | * |
||
122 | * @return File |
||
123 | */ |
||
124 | protected function createFileDriver() |
||
128 | |||
129 | /** |
||
130 | * Create APC driver |
||
131 | * |
||
132 | * @return Apc |
||
133 | */ |
||
134 | protected function createApcDriver() |
||
138 | |||
139 | /** |
||
140 | * Create Memory driver |
||
141 | * |
||
142 | * @return Memory |
||
143 | * @throws \Desarrolla2\Cache\Adapter\MemoryCacheException |
||
144 | */ |
||
145 | protected function createMemoryDriver() |
||
155 | |||
156 | /** |
||
157 | * Create Mongo driver |
||
158 | * |
||
159 | * @return Mongo |
||
160 | */ |
||
161 | protected function createMongoDriver() |
||
165 | |||
166 | /** |
||
167 | * Create MySQL driver |
||
168 | * |
||
169 | * @return MySQL |
||
170 | */ |
||
171 | protected function createMysqlDriver() |
||
180 | |||
181 | /** |
||
182 | * Create Redis driver |
||
183 | * |
||
184 | * @return Redis |
||
185 | */ |
||
186 | protected function createRedisDriver() |
||
190 | |||
191 | /** |
||
192 | * Create MemCache driver |
||
193 | * |
||
194 | * @return MemCache |
||
195 | */ |
||
196 | protected function createMemcacheDriver() |
||
200 | } |
||
201 |