Commit 1f7e8103 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Contournement provisoire du warning ZF 'ServiceLocatorAwareInterface is...

Contournement provisoire du warning ZF 'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0'
parent 09583662
...@@ -6,6 +6,7 @@ use DomainException; ...@@ -6,6 +6,7 @@ use DomainException;
use UnicaenApp\Controller\Plugin\AppInfos; use UnicaenApp\Controller\Plugin\AppInfos;
use UnicaenApp\Controller\Plugin\Mail; use UnicaenApp\Controller\Plugin\Mail;
use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface;
use UnicaenAuth\Service\Traits\ShibServiceAwareTrait; use UnicaenAuth\Service\Traits\ShibServiceAwareTrait;
use UnicaenAuth\Service\Traits\UserServiceAwareTrait; use UnicaenAuth\Service\Traits\UserServiceAwareTrait;
use Zend\Authentication\AuthenticationService; use Zend\Authentication\AuthenticationService;
...@@ -13,6 +14,7 @@ use Zend\Authentication\Exception\ExceptionInterface; ...@@ -13,6 +14,7 @@ use Zend\Authentication\Exception\ExceptionInterface;
use Zend\Http\Request; use Zend\Http\Request;
use Zend\Http\Response; use Zend\Http\Response;
use Zend\Mvc\Controller\AbstractActionController; use Zend\Mvc\Controller\AbstractActionController;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Zend\View\Model\ViewModel; use Zend\View\Model\ViewModel;
use ZfcUser\Controller\Plugin\ZfcUserAuthentication; use ZfcUser\Controller\Plugin\ZfcUserAuthentication;
...@@ -25,8 +27,9 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication; ...@@ -25,8 +27,9 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class AuthController extends AbstractActionController class AuthController extends AbstractActionController implements ServiceLocatorAwareInterface
{ {
use ServiceLocatorAwareTrait;
use ShibServiceAwareTrait; use ShibServiceAwareTrait;
use UserServiceAwareTrait; use UserServiceAwareTrait;
......
...@@ -24,6 +24,9 @@ class AuthControllerFactory ...@@ -24,6 +24,9 @@ class AuthControllerFactory
$controller->setShibService($shibService); $controller->setShibService($shibService);
$controller->setUserService($userService); $controller->setUserService($userService);
// todo: abandonner l'injection du service locator, svp!
$controller->setServiceLocator($cm->getServiceLocator());
return $controller; return $controller;
} }
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ namespace UnicaenAuth\Controller; ...@@ -4,6 +4,7 @@ namespace UnicaenAuth\Controller;
use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface;
use UnicaenAuth\Entity\Db\AbstractUser; use UnicaenAuth\Entity\Db\AbstractUser;
use UnicaenAuth\Entity\Ldap\People; use UnicaenAuth\Entity\Ldap\People;
use UnicaenAuth\Entity\Shibboleth\ShibUser; use UnicaenAuth\Entity\Shibboleth\ShibUser;
...@@ -14,13 +15,16 @@ use Zend\Authentication\AuthenticationService; ...@@ -14,13 +15,16 @@ use Zend\Authentication\AuthenticationService;
use Zend\Http\Request; use Zend\Http\Request;
use Zend\Http\Response; use Zend\Http\Response;
use Zend\Mvc\Controller\AbstractActionController; use Zend\Mvc\Controller\AbstractActionController;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use ZfcUser\Mapper\User as UserMapper; use ZfcUser\Mapper\User as UserMapper;
/** /**
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class UtilisateurController extends AbstractActionController class UtilisateurController extends AbstractActionController implements ServiceLocatorAwareInterface
{ {
use ServiceLocatorAwareTrait;
/** /**
* @var LdapPeopleMapper * @var LdapPeopleMapper
*/ */
......
<?php
namespace UnicaenAuth\Controller;
use Zend\Mvc\Controller\ControllerManager;
class UtilisateurControllerFactory
{
/**
* @param ControllerManager $cm
* @return UtilisateurController
*/
public function __invoke(ControllerManager $cm)
{
$controller = new UtilisateurController();
// todo: ne plus injecter le service locator, svp!
$controller->setServiceLocator($cm->getServiceLocator());
return $controller;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment