| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function load(array $configs, ContainerBuilder $container) |
||
| 20 | { |
||
| 21 | $config = $this->processConfiguration(new Configuration(), $configs); |
||
| 22 | |||
| 23 | if (empty($config['cache'])) { |
||
| 24 | $config['cache'] = $container->getParameter('kernel.cache_dir').'GeoLite2-Country.mmdb'; |
||
| 25 | } |
||
| 26 | |||
| 27 | if (empty($config['url'])) { |
||
| 28 | $config['url'] = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz'; |
||
| 29 | } |
||
| 30 | |||
| 31 | $container->setParameter('geoip2.cache', $config['cache']); |
||
| 32 | $container->setParameter('geoip2.url', $config['url']); |
||
| 33 | |||
| 34 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
||
| 35 | $loader->load('services.yml'); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |