-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathZfcUserAuthentication.php
More file actions
36 lines (29 loc) · 1.06 KB
/
Copy pathZfcUserAuthentication.php
File metadata and controls
36 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace ZfcUser\Factory\Controller\Plugin;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUser\Controller;
class ZfcUserAuthentication implements FactoryInterface
{
public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
{
$authService = $serviceLocator->get('zfcuser_auth_service');
$authAdapter = $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain');
$controllerPlugin = new Controller\Plugin\ZfcUserAuthentication;
$controllerPlugin->setAuthService($authService);
$controllerPlugin->setAuthAdapter($authAdapter);
return $controllerPlugin;
}
/**
* Create service
*
* @param ServiceLocatorInterface $serviceManager
* @return mixed
*/
public function createService(ServiceLocatorInterface $serviceManager)
{
$serviceLocator = $serviceManager;
return $this->__invoke($serviceLocator, null);
}
}