14 class Pool implements \Iterator
24 private $deploymentConfig;
39 private $_frontendSettings;
49 array $frontendSettings = []
52 $this->_factory = $frontendFactory;
53 $this->_frontendSettings = $frontendSettings + [self::DEFAULT_FRONTEND_ID => []];
64 if ($this->_instances ===
null) {
65 $this->_instances = [];
67 $this->_instances[$frontendId] = $this->_factory->create($frontendOptions);
84 if (
null !== $cacheInfo) {
87 return $this->_frontendSettings;
98 return current($this->_instances);
107 return key($this->_instances);
116 next($this->_instances);
125 reset($this->_instances);
134 return (
bool)
current($this->_instances);
144 public function get($identifier)
147 if (isset($this->_instances[$identifier])) {
148 return $this->_instances[$identifier];
150 throw new \InvalidArgumentException(
"Cache frontend '{$identifier}' is not recognized.");
__construct(DeploymentConfig $deploymentConfig, Factory $frontendFactory, array $frontendSettings=[])
const DEFAULT_FRONTEND_ID