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