combine symfony1 and Symfony2 projects

筅森魡賤 提交于 2019-12-03 13:54:46

问题


There is an existing website developed in symfony1.0 (propel as ORM). I have developed a module in Symfony2 (Doctrine2 as ORM) for the website. Both have authentication. New module should use members from existing database. Session between them should not be broken. What steps should I follow? How to handle this?


回答1:


I think you should create a custom user provider in your Symfony2 project to be able to share the users between two projects (but first check if you could use the doctrine user provider).

You should also implement a custom authentication provider to automatically log user in in the Symfony2 app if he was logged in symfony1. You'd probably need to inspect symfony1 session and based on that log user in (or not).

It might be worth looking at the IngewikkeldWrapperBundle which wraps symfony1 project in Symfony2.

It's also worth watching a talk from Symfony Live 2011: Nice performance using Sf2 cache wrapping Sf1 application:

  • video
  • slides

Last but not least go through the docs:

  • Security
  • Security Cookbook entry


来源:https://stackoverflow.com/questions/10426627/combine-symfony1-and-symfony2-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!