从Cake 1.3迁移到2.0及更高版本 - 迁移现有的或仅用于新的? [英] Migrating from Cake 1.3 to 2.0 and beyond - migrate existing, or only use for new?

查看:98
本文介绍了从Cake 1.3迁移到2.0及更高版本 - 迁移现有的或仅用于新的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将完成我的第一个由CakePHP驱动的网站,只是看到他们已经在使用CakePHP 2.0了(不是稳定的版本)。

I'm nearling completion of my first CakePHP-driven website and just saw they're already working on CakePHP 2.0 (not the stable release yet).

strong>我的问题:

My questions:


  • 迁移到新版本的CakePHP是非常耗时的成为稳定版本)?

  • Is it incredibly time consuming to move to a new version of CakePHP (when it becomes the "stable" release that is)? I know they have migration guides, but - I've never used a framework before, so I've never had to migrate anything.

您是否已迁移您的移动设备?

Do you migrate your code for existing projects, or leave it as is and use the new stable version for future projects only?

我在哪里可以找到我目前有哪些版本的CakePHP版本?安装?我已查看LICENSE和VERSION文件,但找不到其中列出的已安装/当前版本。

Where can I find what version of CakePHP I currently have installed? I've looked at the LICENCE and VERSION files, but cannot find the installed/current version listed in them.

这些似乎很简单的问题,但我非常感谢任何想法/建议 - 在Google上搜索这里只是提出了如何迁移页面,而不是优点/缺点...等。

These seem like simple questions, but I greatly appreciate any thoughts/advice - searching this on Google just brings up how-to-migrate pages, not pros/cons...etc.

推荐答案

我已经将几个网站从CakePHP 1.2迁移到1.3。在我的经验,它需要2-3个小时的网站有5-10控制器和没有自定义插件等。我发现我通常只需要改变一些函数调用的语法,当我找出哪些,它只是一个问题在网站上做一个查找/替换。当然,这可能是一个问题从1.3到2.0,但我不知道,这将是一个特别剧烈的API更改。

I've migrated a few sites from CakePHP 1.2 to 1.3. In my experience, it takes 2-3 hours on sites that have 5-10 controllers and no custom plugins, etc. I find I typically only have to change the syntax on a handful of function calls, and when I figure out which ones, it is just a matter of doing a find / replace across the site. Of course it could be more of an issue going from 1.3 to 2.0, but I don't get the sense that it will be an especially drastic API change.

更新:我现在正在迁移到CakePHP 2.0测试版,并认为我应该更新这个,因为我发现更新是更广泛和深远的,比我假设当我写这个。迁移指南: https://github.com/cakephp/ docs / blob / master / en / appendices / 2-0-migration-guide.rst

UPDATE: I'm now in the process of migrating to CakePHP 2.0 beta, and thought I should update this, as I'm finding the updates are more extensive and far-reaching than I had assumed when I wrote this. Migration guide here: https://github.com/cakephp/docs/blob/master/en/appendices/2-0-migration-guide.rst

其他更新似乎发现这有用,我只是想我会指出,蛋糕现在有助于提供一个升级shell,为你做一些工作。请注意,虽然文档说它会做大多数工作,但我发现还有很多函数调用等,需要手动更新(请参阅迁移指南)。
http://book2.cakephp.org/en/console-and- shells / upgrade-shell.html

ANOTHER UPDATE: Since people seem to be finding this useful, I just thought I'd point out that Cake now helpfully provides an upgrade shell that does some of the work for you. Note that although the documentation says it will do "most" of the work, I have found there are still quite a few function calls, etc. that will need to be updated manually (see migration guide). http://book2.cakephp.org/en/console-and-shells/upgrade-shell.html

如dhofstet所说,这将取决于您的网站的大小和复杂性。

As dhofstet said, it will all depend on the size and complexity of your site.

无论你是否升级通常都是一个判断性的调用,但有时你必须(例如Cake 1.2有一些代码,如果你的主机升级到PHP 5.3会破坏)。你肯定不会有一种旧的WordPress,Drupal等安装问题。我已经看到一些明显的速度增加与蛋糕升级,所以根据情况,它可能是值得的麻烦只是为了(蛋糕2.0最终删除PHP 4支持)。查看发行说明,看看是否有新版本吸引您的内容。

Whether you upgrade at all is usually a judgment call, but sometimes you have to (e.g. Cake 1.2 has some code that will break if your host upgrades to PHP 5.3). You certainly wouldn't have the kind of security issues that an old WordPress, Drupal, etc install would have. I have seen some noticeable speed increases with Cake upgrades, so depending on the situation it could be worth the trouble just for that (Cake 2.0 finally drops PHP 4 suppport). Look at the release notes and see if there are things that appeal to you in the new version.

要查看您的版本,请在 cake / VERSION.txt 文件,查看最后一行。这很容易错过,但它应该只是一个数字,例如。 1.3.8

To see your version, in the cake/VERSION.txt file, look at the very last line. It's easy to miss, but it should just be a number, e.g. 1.3.8.

这篇关于从Cake 1.3迁移到2.0及更高版本 - 迁移现有的或仅用于新的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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