I just wanted to write a quick post illustrating how to use the http basic authentication mechanism to test secured pages. Since the testing framework does not support sessions at the moment, it is not possible to write tests using the form login mechanism. Because of this, we have to use http basic authentication to test our secure pages. 我只想快速写一篇文章说明如何使用HTTP基本认证机制来测试安全页面。因为测试框架目前不支持会话,因此不可以使用表单登录机制来编写测试。有鉴于此,我们不得不使用HTTP基本认证来测试我们的安全页面。
Since a post on security was requested, I am going to show you how to secure a route prefix in your application. The symfony2 security component is very powerful and complex. This implementation will be simple, but you should be able to easily build on it. For securing a production application I would strongly recommend using the FOSUserBundle which can be found here. This bundle is written by some of the core developers of symfony2 and will most likely become the “sfGuardPlugin” for symfony2. T
In Part II we configured doctrine to connect to our database, created some managed entities out of plain old PHP objects using annotations and then used those annotations to let doctrine create our database tables for us. In this part, we will set up some routing, use controllers and learn about templating with Twig. We are going to be setting up some static pages to show how routing, controllers and templates work at a high level. In the next part we will start getting to some dynamic content a
In Part I we created a fresh bleeding edge symfony2 project and briefly went over the directory structure of the project. Now we are going to configure our doctrine2 ORM database connection and create our data model. We are going to use doctrine2′s doc-block annotations to transform our plain old PHP objects into managed entities. If you are coming from a symfony1 background like me then the more you work with symfony2 and doctrine2 the more you will realize how much of the “magic” has been remo
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号