Skip to content
Snippets Groups Projects
Commit 7ffe2396 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'usurpation'

parents 32ed5e04 84a4f297
No related branches found
No related tags found
No related merge requests found
......@@ -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
*
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment