使用整个 Symfony 2 应用程序作为本机 php 项目的插件?
I have an old project which I want to add user management to.
Symfony has the FOSUserBundle which makes user straightforward.
Is there a way to integrate Symfony in the old project so that I can benefit from the UserBundle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有现有项目的具体细节,这个问题很难回答。我们不知道该项目是如何建设的。都是意大利面条式的代码吗?是基于MVC的吗?是否使用现有框架?
如果你问 Symfony2 和 FOSUserBundle 是否可以以某种方式硬塞到你的项目中 - 我对此表示怀疑。 Symfony2 的许多功能可以用作独立库,但捆绑包(即 FOSUserBundle)与 Symfony2 的 MVC 堆栈紧密耦合。
你需要问自己是否愿意使用 Symfony2 重写你的项目。如果不是,那么您需要找到另一种用户管理解决方案,该解决方案将与您已经设置的内容一起使用。
This question is extremely hard to answer without specific details of the existing project. We have no idea how the project was constructed. Is it all spaghetti code? Is it MVC based? Is it using an existing framework?
If you're asking if somehow Symfony2 and FOSUserBundle can somehow be shoehorned into your project - I doubt it. A number of Symfony2's features can be used as stand alone libraries, but bundles, and therefore FOSUserBundle, are tightly coupled with Symfony2's MVC stack.
You need to ask yourself if you're willing to rewrite your project using Symfony2. If you're not, then you need to find another solution for user management that will work with what you've already got setup.