1 | <?php |
||
15 | class Configuration implements ConfigurationInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $shmop_salt = ''; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $file_path = ''; |
||
26 | |||
27 | /** |
||
28 | * @param string $shmop_salt |
||
29 | * @param string $file_path |
||
30 | */ |
||
31 | 2 | public function __construct($shmop_salt, $file_path) |
|
36 | |||
37 | /** |
||
38 | * Config tree builder. |
||
39 | * |
||
40 | * Example config: |
||
41 | * |
||
42 | * anime_db_cache_time_keeper: |
||
43 | * enable: true |
||
44 | * use_driver: 'file' |
||
45 | * private_headers: ['Authorization', 'Cookie'] |
||
46 | * etag_hasher: |
||
47 | * driver: 'cache_time_keeper.cache_key_builder.default_etag_hasher' |
||
48 | * algorithm: sha256 |
||
49 | * track: |
||
50 | * clear_cache: true |
||
51 | * individually_entity: false |
||
52 | * drivers: |
||
53 | * multi: |
||
54 | * fast: 'shmop' |
||
55 | * slow: 'file' |
||
56 | * shmop: |
||
57 | * salt: '%secret%' |
||
58 | * file: |
||
59 | * path: '%kernel.root_dir%/cache/cache-time-keeper/' |
||
60 | * memcache: |
||
61 | * prefix: 'cache_time_keeper_' |
||
62 | * hosts: |
||
63 | * - {host: 'localhost', port: 11211, weight: 100} |
||
64 | * |
||
65 | * @return TreeBuilder |
||
66 | */ |
||
67 | 2 | public function getConfigTreeBuilder() |
|
97 | |||
98 | /** |
||
99 | * @return ArrayNodeDefinition |
||
100 | */ |
||
101 | 2 | protected function getEtagHasher() |
|
118 | |||
119 | /** |
||
120 | * @return ArrayNodeDefinition |
||
121 | */ |
||
122 | 2 | protected function getTrack() |
|
137 | |||
138 | /** |
||
139 | * @return ArrayNodeDefinition |
||
140 | */ |
||
141 | 2 | protected function getDriverMulti() |
|
158 | |||
159 | /** |
||
160 | * @return ArrayNodeDefinition |
||
161 | */ |
||
162 | 2 | protected function getDriverShmop() |
|
175 | |||
176 | /** |
||
177 | * @return ArrayNodeDefinition |
||
178 | */ |
||
179 | 2 | protected function getDriverFile() |
|
192 | |||
193 | /** |
||
194 | * @return ArrayNodeDefinition |
||
195 | */ |
||
196 | 2 | protected function getDriverMemcache() |
|
238 | } |
||
239 |