在一个网站上使用多个PHP框架 [英] Using multiple php frameworks on one website

查看:140
本文介绍了在一个网站上使用多个PHP框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的主要网站使用的symfony 1,并通过时间,我开始在code工作似乎是不可能的升级(从previous开发商太多的定制code)。现在我们加入了大量除了企业提供的东西。而是采用了真的老框架,我想用codeIgniter,还因为我很熟悉它。我真正的问题:

Our main website uses symfony 1, and by the time I started working on the code it seems impossible to upgrade (too much custom code from previous developer). Now we are adding a large addition to what the company offers. Instead of using a really old framework I wanted to use CodeIgniter, also since I'm very familiar with it. My real question:

什么是设立一个网站使用多个框架之有道。新特征将是从原始网站分开,但是它仍然需要在数据库的几个表

What is a proper way of setting up a website to use multiple frameworks. The new features will be separate from the original website, but it will still need a few tables of the database.

我将不得不阿帕奇手柄所在的根目录是根据不同的网址,只是尽一切正常。主要的网站是example.com,新功能将abc.example.com

I was going to have apache handle where the root directory was depending on the url and just do everything normally. The main website is example.com and the new feature will be abc.example.com

我真的想找谁做了这个人一些提示和警告他们了。

I'm really looking for people who have done this and some tips and warning they had.

推荐答案

PHP将根据该目录装载在服务器上运行的框架。例如,在大多数的Apache服务器来 example.com 根目录将是 / WWW 。这意味着所有的code为交响乐团的将是 / WWW / *

PHP will run the framework based on which directory is loaded on the server. For instance, on most apache servers the root directory for example.com would be /www. Which means all of the code for Symphony would be in /www/*.

当您建立子域名的路径,只要把它的 / WWW 文件夹之外。然后,当你去abc.example.com Apache将不会尝试与交响乐团一起框架加载原来的网站。

When you setup the path of your subdomain, just put it outside of the /www folder. Then, when you go to abc.example.com apache won't try to load the original site along with the Symphony framework.

我认为这将是罚款,这两个框架共享同一个数据库表。我不完全知道如何你打算为这两个应用程序的工作,但只要你不改变列名和类型,你应该没问题。

I think it will be fine for both frameworks to share the same database tables. I'm not entirely sure how you plan for these two applications to work, but as long as you don't change the column names and types you should be okay.

如果您不希望应用程序共享数据在原表,则考虑使用 mysqldump的 或类似的东西将数据转移到一个新的表复制。

If you don't want the applications to share the data in the original table, then look into using mysqldump or something of the like to copy the data over to a new table.

这篇关于在一个网站上使用多个PHP框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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