Loading src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php +8 −2 Changes for src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -25,9 +26,14 @@ class AuthenticationIdentityProviderServiceFactory implements FactoryInterface */ public function createService(ServiceLocatorInterface $serviceLocator) { $user = $serviceLocator->get('zfcuser_user_service'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $user = $container->get('zfcuser_user_service'); $simpleIdentityProvider = new AuthenticationIdentityProvider($user->getAuthService()); $config = $serviceLocator->get('BjyAuthorize\Config'); $config = $container->get('BjyAuthorize\Config'); $simpleIdentityProvider->setDefaultRole($config['default_role']); $simpleIdentityProvider->setAuthenticatedRole($config['authenticated_role']); Loading src/BjyAuthorize/Service/AuthorizeAwareServiceInitializer.php +7 −4 Changes for src/BjyAuthorize/Service/AuthorizeAwareServiceInitializer.php: 7 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\InitializerInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -21,17 +22,19 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class AuthorizeAwareServiceInitializer implements InitializerInterface { /** * {@inheritDoc} */ public function initialize($instance, ServiceLocatorInterface $serviceLocator) { $this->__invoke($serviceLocator, $instance); } public function __invoke(ContainerInterface $container, $instance) { if (! $instance instanceof AuthorizeAwareInterface) { return; } /* @var $authorize \BjyAuthorize\Service\Authorize */ $authorize = $serviceLocator->get('BjyAuthorize\Service\Authorize'); $authorize = $container->get('BjyAuthorize\Service\Authorize'); $instance->setAuthorizeService($authorize); } Loading src/BjyAuthorize/Service/AuthorizeFactory.php +7 −6 Changes for src/BjyAuthorize/Service/AuthorizeFactory.php: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -18,13 +19,13 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class AuthorizeFactory implements FactoryInterface { /** * {@inheritDoc} * * @return \BjyAuthorize\Service\Authorize */ public function createService(ServiceLocatorInterface $serviceLocator) { return new Authorize($serviceLocator->get('BjyAuthorize\Config'), $serviceLocator); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { return new Authorize($container->get('BjyAuthorize\Config'), $container); } } src/BjyAuthorize/Service/BaseProvidersServiceFactory.php +10 −6 Changes for src/BjyAuthorize/Service/BaseProvidersServiceFactory.php: 10 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -22,19 +23,22 @@ abstract class BaseProvidersServiceFactory implements FactoryInterface /** * {@inheritDoc} * * @return array */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('BjyAuthorize\Config'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $config = $container->get('BjyAuthorize\Config'); $providers = array(); foreach ($config[static::PROVIDER_SETTING] as $providerName => $providerConfig) { if ($serviceLocator->has($providerName)) { $providers[] = $serviceLocator->get($providerName); if ($container->has($providerName)) { $providers[] = $container->get($providerName); } else { $providers[] = new $providerName($providerConfig, $serviceLocator); $providers[] = new $providerName($providerConfig, $container); } } Loading src/BjyAuthorize/Service/CacheFactory.php +7 −8 Changes for src/BjyAuthorize/Service/CacheFactory.php: 7 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ namespace BjyAuthorize\Service; use Zend\Cache\Storage\StorageInterface; use Interop\Container\ContainerInterface; use Zend\Cache\StorageFactory; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -20,15 +20,14 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class CacheFactory implements FactoryInterface { /** * Create a cache * * @param ServiceLocatorInterface $serviceLocator * @return StorageInterface */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = $serviceLocator->get('BjyAuthorize\Config'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $options = $container->get('BjyAuthorize\Config'); return StorageFactory::factory($options['cache_options']); } Loading Loading
src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php +8 −2 Changes for src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -25,9 +26,14 @@ class AuthenticationIdentityProviderServiceFactory implements FactoryInterface */ public function createService(ServiceLocatorInterface $serviceLocator) { $user = $serviceLocator->get('zfcuser_user_service'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $user = $container->get('zfcuser_user_service'); $simpleIdentityProvider = new AuthenticationIdentityProvider($user->getAuthService()); $config = $serviceLocator->get('BjyAuthorize\Config'); $config = $container->get('BjyAuthorize\Config'); $simpleIdentityProvider->setDefaultRole($config['default_role']); $simpleIdentityProvider->setAuthenticatedRole($config['authenticated_role']); Loading
src/BjyAuthorize/Service/AuthorizeAwareServiceInitializer.php +7 −4 Changes for src/BjyAuthorize/Service/AuthorizeAwareServiceInitializer.php: 7 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\InitializerInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -21,17 +22,19 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class AuthorizeAwareServiceInitializer implements InitializerInterface { /** * {@inheritDoc} */ public function initialize($instance, ServiceLocatorInterface $serviceLocator) { $this->__invoke($serviceLocator, $instance); } public function __invoke(ContainerInterface $container, $instance) { if (! $instance instanceof AuthorizeAwareInterface) { return; } /* @var $authorize \BjyAuthorize\Service\Authorize */ $authorize = $serviceLocator->get('BjyAuthorize\Service\Authorize'); $authorize = $container->get('BjyAuthorize\Service\Authorize'); $instance->setAuthorizeService($authorize); } Loading
src/BjyAuthorize/Service/AuthorizeFactory.php +7 −6 Changes for src/BjyAuthorize/Service/AuthorizeFactory.php: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -18,13 +19,13 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class AuthorizeFactory implements FactoryInterface { /** * {@inheritDoc} * * @return \BjyAuthorize\Service\Authorize */ public function createService(ServiceLocatorInterface $serviceLocator) { return new Authorize($serviceLocator->get('BjyAuthorize\Config'), $serviceLocator); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { return new Authorize($container->get('BjyAuthorize\Config'), $container); } }
src/BjyAuthorize/Service/BaseProvidersServiceFactory.php +10 −6 Changes for src/BjyAuthorize/Service/BaseProvidersServiceFactory.php: 10 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ namespace BjyAuthorize\Service; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -22,19 +23,22 @@ abstract class BaseProvidersServiceFactory implements FactoryInterface /** * {@inheritDoc} * * @return array */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('BjyAuthorize\Config'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $config = $container->get('BjyAuthorize\Config'); $providers = array(); foreach ($config[static::PROVIDER_SETTING] as $providerName => $providerConfig) { if ($serviceLocator->has($providerName)) { $providers[] = $serviceLocator->get($providerName); if ($container->has($providerName)) { $providers[] = $container->get($providerName); } else { $providers[] = new $providerName($providerConfig, $serviceLocator); $providers[] = new $providerName($providerConfig, $container); } } Loading
src/BjyAuthorize/Service/CacheFactory.php +7 −8 Changes for src/BjyAuthorize/Service/CacheFactory.php: 7 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ namespace BjyAuthorize\Service; use Zend\Cache\Storage\StorageInterface; use Interop\Container\ContainerInterface; use Zend\Cache\StorageFactory; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; Loading @@ -20,15 +20,14 @@ use Zend\ServiceManager\ServiceLocatorInterface; */ class CacheFactory implements FactoryInterface { /** * Create a cache * * @param ServiceLocatorInterface $serviceLocator * @return StorageInterface */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = $serviceLocator->get('BjyAuthorize\Config'); return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $options = $container->get('BjyAuthorize\Config'); return StorageFactory::factory($options['cache_options']); } Loading