1 | <?php |
||
29 | class CacheItemPoolFactory |
||
30 | { |
||
31 | public const DEFAULT_ADAPTERS_CONFIG = [ |
||
32 | 'array' => [ |
||
33 | 'default_lifetime' => 0, |
||
34 | 'store_serialized' => true, |
||
35 | ], |
||
36 | 'apcu' => [ |
||
37 | 'namespace' => '', |
||
38 | 'default_lifetime' => 0, |
||
39 | 'version' => null, |
||
40 | ], |
||
41 | 'filesystem' => [ |
||
42 | 'namespace' => '', |
||
43 | 'default_lifetime' => 0, |
||
44 | 'directory' => null, |
||
45 | ], |
||
46 | 'redis' => [ |
||
47 | 'instance' => null, |
||
48 | 'namespace' => '', |
||
49 | 'default_lifetime' => 0, |
||
50 | ], |
||
51 | 'pdo' => [ |
||
52 | 'instance' => null, |
||
53 | 'dns' => null, |
||
54 | 'namespace' => '', |
||
55 | 'default_lifetime' => 0, |
||
56 | 'options' => [], |
||
57 | ], |
||
58 | 'php_files' => [ |
||
59 | 'namespace' => '', |
||
60 | 'default_lifetime' => 0, |
||
61 | 'directory' => null, |
||
62 | ], |
||
63 | 'chain' => [ |
||
64 | 'adapters' => ['array'], |
||
65 | ], |
||
66 | ]; |
||
67 | |||
68 | /** |
||
69 | * @param ContainerInterface $container |
||
70 | * |
||
71 | * @return CacheItemPoolInterface |
||
72 | * |
||
73 | * @throws \Symfony\Component\Cache\Exception\CacheException |
||
74 | */ |
||
75 | public function __invoke(ContainerInterface $container): CacheItemPoolInterface |
||
83 | |||
84 | /** |
||
85 | * @param ContainerInterface $container |
||
86 | * @param string $adapter |
||
87 | * |
||
88 | * @return AdapterInterface |
||
89 | * |
||
90 | * @throws \Symfony\Component\Cache\Exception\CacheException |
||
91 | */ |
||
92 | protected function createAdapter(ContainerInterface $container, string $adapter): AdapterInterface |
||
141 | |||
142 | /** |
||
143 | * Retrieves the config for a specific adapter. |
||
144 | * |
||
145 | * @param ContainerInterface $container |
||
146 | * @param string $adapter |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | protected function retrieveAdapterConfig(ContainerInterface $container, string $adapter): array |
||
161 | } |
||
162 |