结合symfony1和Symfony2项目 [英] combine symfony1 and Symfony2 projects

查看:64
本文介绍了结合symfony1和Symfony2项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现有一个用symfony1.0开发的网站(称为ORM).我已经在Symfony2(Doctrine2作为ORM)中为该网站开发了一个模块.两者都具有身份验证.新模块应使用现有数据库中的成员.它们之间的会话不应中断.我应该遵循什么步骤?该如何处理?

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?

推荐答案

我认为您应该创建

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).

您还应该实施自定义身份验证提供程序,以自动记录用户如果他已登录symfony1,则在Symfony2应用程序中登录.您可能需要检查symfony1会话,并基于登录用户(或不登录)进行检查.

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).

也许值得研究一下 IngewikkeldWrapperBundle ,它将symfony1项目包装在Symfony2中.

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

Symfony Live 2011中的一个演讲也很值得一看:使用Sf2缓存包装Sf1应用程序可获得出色的性能:

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

这篇关于结合symfony1和Symfony2项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆