简体   繁体   English

结合symfony1和Symfony2项目

[英]combine symfony1 and Symfony2 projects

There is an existing website developed in symfony1.0 (propel as ORM). 在symfony1.0中开发了一个现有的网站(推进为ORM)。 I have developed a module in Symfony2 (Doctrine2 as ORM) for the website. 我已经在Symfony2(Doctrine2 as ORM)中为该网站开发了一个模块。 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? 怎么办呢?

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 ). 我认为您应该在Symfony2项目中创建一个自定义用户提供程序 ,以便能够在两个项目之间共享用户(但首先要检查是否可以使用doctrine用户提供程序 )。

You should also implement a custom authentication provider to automatically log user in in the Symfony2 app if he was logged in symfony1. 如果他已登录symfony1,您还应该实现自定义身份验证提供程序以自动在Symfony2应用程序中登录用户。 You'd probably need to inspect symfony1 session and based on that log user in (or not). 您可能需要检查symfony1会话并基于该日志用户(或不)。

It might be worth looking at the IngewikkeldWrapperBundle which wraps symfony1 project in Symfony2. 值得一看的是在Symfony2中包装symfony1项目的IngewikkeldWrapperBundle

It's also worth watching a talk from Symfony Live 2011: Nice performance using Sf2 cache wrapping Sf1 application: 同样值得观看Symfony Live 2011的演讲:使用Sf2缓存包装Sf1应用程序的不错表现:

Last but not least go through the docs: 最后但并非最不重要的是通过文档:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM