GeoLocatorManager.php in GeoIP API 8.2
File
src/GeoLocatorManager.php
View source
<?php
namespace Drupal\geoip;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class GeoLocatorManager extends DefaultPluginManager {
protected $defaults = [
'weight' => 0,
'description' => '',
];
protected $instances = [];
public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) {
$interface = 'Drupal\\geoip\\Plugin\\GeoLocator\\GeoLocatorInterface';
$annotation = 'Drupal\\geoip\\Annotation\\GeoLocator';
parent::__construct('Plugin/GeoLocator', $namespaces, $module_handler, $interface, $annotation);
$this
->alterInfo('geolocator');
$this
->setCacheBackend($cache_backend, 'geolocator_plugins', [
'geoip',
]);
}
}