예제 #1
0
 /**
  * Returns the current security instance or firewall if firewall key is given
  *
  * @param null|string $firewall Firewall key
  *
  * @throws SecurityException
  * @return Security|Firewall
  */
 protected static function security($firewall = null)
 {
     if ($firewall) {
         return Security::getInstance()->firewall($firewall);
     }
     return Security::getInstance();
 }
예제 #2
0
 public function dataProvider()
 {
     Security::setConfig(__DIR__ . '/ExampleConfig.yaml');
     $security = Security::getInstance();
     return [[$security]];
 }
예제 #3
0
<?php

require_once '../vendor/autoload.php';
\Webiny\Component\Security\Security::setConfig('./securityConfig.yaml');
\Webiny\Component\Mongo\Mongo::setConfig('./mongoConfig.yaml');
\Webiny\Component\Entity\Entity::setConfig('./entityConfig.yaml');
$security = \Webiny\Component\Security\Security::getInstance();
$loginConfig = \Webiny\Component\Config\Config::getInstance()->yaml('./loginConfig.yaml');
$login = new \Webiny\Login\Login($security, $loginConfig);