Loading src/UnicaenAuth/Authentication/Storage/ChainServiceFactory.php +9 −2 Original line number Diff line number Diff line Loading @@ -12,11 +12,15 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class ChainServiceFactory implements FactoryInterface { protected $storages = [ private $mandatoryStorages = [ 200 => 'UnicaenAuth\Authentication\Storage\Ldap', 100 => 'UnicaenAuth\Authentication\Storage\Db', 76 => 'UnicaenAuth\Authentication\Storage\ShibSimulatorStorage', 75 => 'UnicaenAuth\Authentication\Storage\Shib', ]; protected $storages = []; /** * Create service * Loading @@ -27,7 +31,10 @@ class ChainServiceFactory implements FactoryInterface { $chain = new Chain(); foreach ($this->storages as $priority => $name) { $storages = $this->mandatoryStorages + $this->storages; krsort($storages); foreach ($storages as $priority => $name) { $storage = $serviceLocator->get($name); $chain->getEventManager()->attach('read', [$storage, 'read'], $priority); $chain->getEventManager()->attach('write', [$storage, 'write'], $priority); Loading Loading
src/UnicaenAuth/Authentication/Storage/ChainServiceFactory.php +9 −2 Original line number Diff line number Diff line Loading @@ -12,11 +12,15 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class ChainServiceFactory implements FactoryInterface { protected $storages = [ private $mandatoryStorages = [ 200 => 'UnicaenAuth\Authentication\Storage\Ldap', 100 => 'UnicaenAuth\Authentication\Storage\Db', 76 => 'UnicaenAuth\Authentication\Storage\ShibSimulatorStorage', 75 => 'UnicaenAuth\Authentication\Storage\Shib', ]; protected $storages = []; /** * Create service * Loading @@ -27,7 +31,10 @@ class ChainServiceFactory implements FactoryInterface { $chain = new Chain(); foreach ($this->storages as $priority => $name) { $storages = $this->mandatoryStorages + $this->storages; krsort($storages); foreach ($storages as $priority => $name) { $storage = $serviceLocator->get($name); $chain->getEventManager()->attach('read', [$storage, 'read'], $priority); $chain->getEventManager()->attach('write', [$storage, 'write'], $priority); Loading