@@ 105-110 (lines=6) @@ | ||
102 | } |
|
103 | ||
104 | if (isset($config['cache']) || isset($config['cache_lifetime'])) { |
|
105 | if (null === $cacheServiceId = $config['cache']) { |
|
106 | if (!$container->has('app.cache')) { |
|
107 | throw new \LogicException('You need to specify a service for cache.'); |
|
108 | } |
|
109 | $cacheServiceId = 'app.cache'; |
|
110 | } |
|
111 | $plugins[] = $providerServiceId.'.cache'; |
|
112 | $container->register($providerServiceId.'.cache', CachePlugin::class) |
|
113 | ->setPublic(false) |
|
@@ 172-177 (lines=6) @@ | ||
169 | throw new \LogicException('You must install "geocoder-php/cache-provider" to use cache.'); |
|
170 | } |
|
171 | ||
172 | if (null === $cacheServiceId = $providerConfig['cache']) { |
|
173 | if (!$container->has('app.cache')) { |
|
174 | throw new \LogicException('You need to specify a service for cache.'); |
|
175 | } |
|
176 | $cacheServiceId = 'app.cache'; |
|
177 | } |
|
178 | ||
179 | $container->register($serviceId.'.cache', ProviderCache::class) |
|
180 | ->setDecoratedService($serviceId) |