本文整理汇总了PHP中Zend\Authentication\AuthenticationService::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthenticationService::__construct方法的具体用法?PHP AuthenticationService::__construct怎么用?PHP AuthenticationService::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Authentication\AuthenticationService
的用法示例。
在下文中一共展示了AuthenticationService::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(StorageInterface $storage, AdapterInterface $adapter, Container $container)
{
parent::__construct($storage, $adapter);
$this->container = $container;
if (!$this->container->profiles) {
$this->container->profiles = new ArrayObject();
}
}
示例2: __construct
public function __construct(Storage\StorageInterface $storage = null, Adapter\AdapterInterface $adapter = null, SessionConfig $sessionConfig, ResponseInterface $response, RequestInterface $request)
{
parent::__construct($storage, $adapter);
if (!$response instanceof Response) {
$response = new Response();
}
if (!$request instanceof Request) {
$request = new Request();
}
$this->response = $response;
$this->request = $request;
$this->sessionConfig = $sessionConfig;
}
示例3: __construct
/**
* Registriert die Module aus der DB mit Zend/Auth
* Setzt die Rechte der Gruppen
*
* @param $sm
*/
public function __construct($sm)
{
$authSessionStorage = new Session('AUTH_IDENTITY');
parent::__construct($authSessionStorage);
$em = $sm->get('Doctrine\\ORM\\EntityManager');
$acl = new ZendAcl();
// add roles
foreach ($em->getRepository('Auth\\Entity\\Role')->findBy(array(), array('parentId' => 'ASC')) as $role) {
if ($role->parent) {
$parentName = $role->parent->name;
} else {
$parentName = null;
}
$acl->addRole(new GenericRole($role->name), $parentName);
}
// add resources + action
foreach ($em->getRepository('Auth\\Entity\\Resource')->findBy(array(), array('modul' => 'DESC')) as $resource) {
$ressouceName = $resource->modul;
if ($resource->action) {
$ressouceName .= '/' . $resource->action;
}
if ($resource->subAction) {
$ressouceName .= '/' . $resource->subAction;
}
$acl->addResource(new GenericResource($ressouceName));
}
unset($ressouceName);
// deny all
$acl->deny(null);
// add permissions
foreach ($em->getRepository('Auth\\Entity\\Permission')->findAll() as $permission) {
// allow
$permissionName = $permission->resource->modul;
if ($permission->resource->action) {
$permissionName .= '/' . $permission->resource->action;
}
if ($permission->resource->subAction) {
$permissionName .= '/' . $permission->resource->subAction;
}
$acl->allow($permission->gruppe->name, $permissionName);
}
// register identity
if (!$this->hasIdentity()) {
// register as gast
$benutzer = new Benutzer();
$benutzer->setUsername('Unbekannter User');
$benutzer->setId(0);
$benutzer->setLoggedIn(false);
$gruppe = new Role();
$gruppe->id = 2;
$gruppe->name = 'Gast';
$gruppe->supervisor = 0;
$benutzer->setGruppe($gruppe);
if (!$benutzer) {
throw new \Exception('Gastbenutzer mit der ID -1 nicht vorhanden - bitte direkt in der Datenbank anlegen');
}
$this->getStorage()->write($benutzer);
}
// register acl in navigation
\Zend\View\Helper\Navigation\AbstractHelper::setDefaultAcl($acl);
\Zend\View\Helper\Navigation\AbstractHelper::setDefaultRole($this->getIdentity()->getGruppe()->name);
$this->acl = $acl;
$this->sm = $sm;
$this->em = $em;
return $this;
}
示例4: __construct
/**
* @param EventManager $eventManager
* @param EntityManager|null $entityManager
* @param Storage\StorageInterface|null $storageInterface
* @param Adapter\AdapterInterface|null $adapterInterface
*/
public function __construct(EventManager $eventManager, EntityManager $entityManager, Storage\StorageInterface $storageInterface = null, Adapter\AdapterInterface $adapterInterface = null)
{
parent::__construct($storageInterface, $adapterInterface);
$this->entityManager = $entityManager;
$this->eventManager = $eventManager;
}
示例5: __construct
public function __construct(EntityManager $entityManager, StorageInterface $storage, AdapterInterface $adapter)
{
parent::__construct($storage, $adapter);
$this->entityManager = $entityManager;
}
示例6: __construct
/**
* Constructor
*
* @param ServiceLocatorInterface $serviceLocator
* @param StorageInterface $storage
* @param AdapterInterface $adapter
*/
public function __construct(ServiceLocatorInterface $serviceLocator, StorageInterface $storage = null, AdapterInterface $adapter = null)
{
$this->setServiceLocator($serviceLocator);
parent::__construct($storage, $adapter);
}
示例7: __construct
public function __construct()
{
$callbackAdapter = $this->createCallbackAdapter();
parent::__construct(null, $callbackAdapter);
}
示例8:
function __construct(StorageInterface $storage = null, AdapterInterface $adapter = null)
{
parent::__construct($storage, $adapter);
}