如何将 Yii 1.x 升级到 Yii 2.0 [英] How to upgrade Yii 1.x to Yii 2.0

查看:23
本文介绍了如何将 Yii 1.x 升级到 Yii 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 Yii 1.x 版本升级到 Yii 2.0 最新发布版本?我正在使用 ubuntu 操作系统,如何将旧的 Yii 更新到新的 Yii 2.0 版?

How to upgrade Yii 1.x version to Yii 2.0 latest release version? I am using ubuntu OS , Process to updating my old Yii to new Yii release version 2.0?

推荐答案

Yii2 指南在这方面有很好的文档参见 从 v1 升级

The Yii2 guide has excellent documentation in this regard see Upgrade from v1

我最近将几个中等复杂的应用程序从 Yii 1.x 迁移到 Yii 2.0.有两种方法可以解决它,或者你可以同时运行 Yii 1.x 和 Yii 2 参见 使用-yii-2-with-yii-1.然后一点一点地迁移,虽然这可能会有点痛苦,就像住在三楼的时候试图重建二楼一样.

I recently migrated couple of moderately complex applications from Yii 1.x to Yii 2.0. There are two ways to go about it , either you can run Yii 1.x and Yii 2 at the same time see using-yii-2-with-yii-1. Then migrate part by part, while it is possible it was quite bit of pain, like trying to rebuild the second floor while living on the third.

或者,您可以使用完全相同的功能自下而上重写整个应用程序,我发现这样做效率更高,只需稍作修改即可重用重要代码,这也提供了在不更改功能的情况下调整设计的机会.

Alternatively you can rewrite the entire application bottom up with the exact same functionality, I found this to be much more efficient, significant code could be reused with only minor modifications, also that gave opportunity to tweak the design without changing functionality.

重要的是确保公开的 API(即前端/用户界面/功能)保持不变.在重写期间更新功能或更改特性总是很诱人,但是如果您坚持严格为 Yii2 重新实现所有内容,然后考虑更改您的 API,您的迁移将更加顺利.

The important thing is to ensure the exposed API ( i.e. the frontend / UI / functionality) remains the same. It is always tempting to update functionality or change features during a rewrite, however if you stick to strictly reimplementing everything for Yii2 then consider changing your API, your migration will be smoother.

这篇关于如何将 Yii 1.x 升级到 Yii 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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