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
Pipeline #3798 passed with stage
in 22 seconds
......@@ -6,6 +6,7 @@ use DomainException;
use UnicaenApp\Controller\Plugin\AppInfos;
use UnicaenApp\Controller\Plugin\Mail;
use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface;
use UnicaenAuth\Service\Traits\ShibServiceAwareTrait;
use UnicaenAuth\Service\Traits\UserServiceAwareTrait;
use Zend\Authentication\AuthenticationService;
......@@ -13,6 +14,7 @@ use Zend\Authentication\Exception\ExceptionInterface;
use Zend\Http\Request;
use Zend\Http\Response;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Zend\View\Model\ViewModel;
use ZfcUser\Controller\Plugin\ZfcUserAuthentication;
......@@ -25,8 +27,9 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class AuthController extends AbstractActionController
class AuthController extends AbstractActionController implements ServiceLocatorAwareInterface
{
use ServiceLocatorAwareTrait;
use ShibServiceAwareTrait;
use UserServiceAwareTrait;
......
......@@ -24,6 +24,9 @@ class AuthControllerFactory
$controller->setShibService($shibService);
$controller->setUserService($userService);
// todo: abandonner l'injection du service locator, svp!
$controller->setServiceLocator($cm->getServiceLocator());
return $controller;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ namespace UnicaenAuth\Controller;
use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface;
use UnicaenAuth\Entity\Db\AbstractUser;
use UnicaenAuth\Entity\Ldap\People;
use UnicaenAuth\Entity\Shibboleth\ShibUser;
......@@ -14,13 +15,16 @@ use Zend\Authentication\AuthenticationService;
use Zend\Http\Request;
use Zend\Http\Response;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use ZfcUser\Mapper\User as UserMapper;
/**
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class UtilisateurController extends AbstractActionController
class UtilisateurController extends AbstractActionController implements ServiceLocatorAwareInterface
{
use ServiceLocatorAwareTrait;
/**
* @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
Markdown is supported
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