Beispiel #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();
 }
Beispiel #2
0
 public function dataProvider()
 {
     Security::setConfig(__DIR__ . '/ExampleConfig.yaml');
     $security = Security::getInstance();
     return [[$security]];
 }
Beispiel #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);