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