@@ 8-19 (lines=12) @@ | ||
5 | ||
6 | use League\Flysystem\Cached\Storage\Predis; |
|
7 | ||
8 | class PredisCacheFactory extends ContainerAwareCacheAbstract |
|
9 | { |
|
10 | public function __invoke(array $options) |
|
11 | { |
|
12 | $serviceName = $options['service'] ?? null; |
|
13 | $key = $options['key'] ?? 'flysystem'; |
|
14 | $ttl = $options['ttl'] ?? null; |
|
15 | ||
16 | $service = $this->getService($serviceName); |
|
17 | return new Predis($service, $key, $ttl); |
|
18 | } |
|
19 | } |
|
20 |
@@ 8-19 (lines=12) @@ | ||
5 | ||
6 | use League\Flysystem\Cached\Storage\Psr6Cache; |
|
7 | ||
8 | class Psr6CacheFactory extends ContainerAwareCacheAbstract |
|
9 | { |
|
10 | public function __invoke(array $options) |
|
11 | { |
|
12 | $serviceName = $options['service'] ?? null; |
|
13 | $key = $options['key'] ?? 'flysystem'; |
|
14 | $ttl = $options['ttl'] ?? null; |
|
15 | ||
16 | $service = $this->getService($serviceName); |
|
17 | return new Psr6Cache($service, $key, $ttl); |
|
18 | } |
|
19 | } |
|
20 |