$app['security.firewalls'] = array( 'admin' => array( 'pattern' => '^/_admin/.+','form' => array('login_path' => '/_admin/','check_path' => '/_admin/login_check'),'logout' => array('logout_path' => '/_admin/logout'),'users' => array( 'admin' => array('ROLE_ADMIN','5FZ2Z8QIkA7UTZ4BYkoC+GsR...'),),); $app->register(new Silex\Provider\SecurityServiceProvider());
这只是抛出:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Identifier "security.authentication_providers" is not defined.'
根据文档在某些情况下,当您要访问安全功能之外的处理请求时,您必须调用$app-> boot();但这不是我的情况.
如果我调用$app-> boot();在$app->注册(…)之前,它不会引发任何异常,但它可能根本无法启动,因为在生成登录表单Twig throws时:
Unable to generate a URL for the named route "_admin_login_check" as such route does not exist.
有an issue a few months ago可能是同样的问题,但它是关闭的,所以我猜应该现在修复