当前位置: 首页>>代码示例>>PHP>>正文


PHP AuthenticationService::__construct方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:phpdatabase,项目名称:phpdatabase,代码行数:8,代码来源:AuthenticationService.php

示例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;
 }
开发者ID:andreas-serlo,项目名称:athene2,代码行数:13,代码来源:AuthenticationService.php

示例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;
 }
开发者ID:GlitchedMan,项目名称:armasquads,代码行数:72,代码来源:Acl.php

示例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;
 }
开发者ID:PrimeAltis,项目名称:armasquads,代码行数:12,代码来源:AuthenticationService.php

示例5: __construct

 public function __construct(EntityManager $entityManager, StorageInterface $storage, AdapterInterface $adapter)
 {
     parent::__construct($storage, $adapter);
     $this->entityManager = $entityManager;
 }
开发者ID:zource,项目名称:zource,代码行数:5,代码来源:AuthenticationService.php

示例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);
 }
开发者ID:gridguyz,项目名称:core,代码行数:12,代码来源:AuthenticationService.php

示例7: __construct

 public function __construct()
 {
     $callbackAdapter = $this->createCallbackAdapter();
     parent::__construct(null, $callbackAdapter);
 }
开发者ID:iprdp,项目名称:sample-cart,代码行数:5,代码来源:AuthenticationService.php

示例8:

 function __construct(StorageInterface $storage = null, AdapterInterface $adapter = null)
 {
     parent::__construct($storage, $adapter);
 }
开发者ID:arbi,项目名称:MyCode,代码行数:4,代码来源:BackofficeAuthenticationService.php


注:本文中的Zend\Authentication\AuthenticationService::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。