duanpuqi9965 2011-02-28 11:58
浏览 37

将一个非常大的php代码库迁移到rails的理想选择是什么?

im just soliciting opinions/advices. Like we have this really large PHP code base, by large these are what i meant:

over 500 tables over 4000 files - action, displays & templates. over 1,000,000 lines of code - this software spans more than 8 years already.

So many deprecated, duplicated code all over the place, and so many hacks.

I want to be able to still run the software, while parts of it are being migrated to rails.

So it will be running in hybrid mode, that is, both PHP and rails at the same time. Parts of the software that hav been migrated already, will start using the Rails version.

I suppose my idea is:

  1. migrate to Git
  2. I suppose all the more than 500 tables remain.
  3. Find a way so PHP and rails will interoperate?
  4. Chew one display & management screen at a time?
  5. Work on the front end?
  • 写回答

2条回答 默认 最新

  • dousha7645 2011-02-28 12:26
    关注

    I expect such a thing is going to be toff. Anyway let me try to give some advice.

    1. Build both basic "runnable" applications.
    2. Make sure that both applications can access the same database, the same session sources, the same cache and so on. Here'll you have to make sure that that your data sources are compatible to both your applications. For example: you could migrate your user sessions to the database.
    3. Build an extra routing component (in mod_rewrite, PHP or whatever you like) to start routing several pages to your Ruby application instead to PHP. Test it thorougly. Build the router in such way that it can function in development mode as well as in production mode.
    4. Slowly start adding routes to your router for added components in your Ruby application.
    5. When you've completely migrated, change the default route to your Ruby application. You can start using Ruby-specific data sources now.
    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮