从kohana 2.3升级到3.3

时间:2022-10-13 16:25:47

I have a project written in kohana 2.3. It has to be rewritten to 3.3, and while doing this, I wanna clean the whole code up, fix some bugs etc. The project itself contains >10k lines of code.

我有一个用kohana 2.3编写的项目。它必须重写为3.3,并且在执行此操作时,我想清理整个代码,修复一些错误等。项目本身包含> 10k行代码。

What would you recommend me, rewriting everything from a scratch, or simply fixing everything step-by-step in the native code?

你会推荐我什么,从头开始重写所有内容,或者只是在本机代码中逐步修复所有内容?

2 个解决方案

#1


2  

I would recommend writing everything from scratch. There is an enormous difference between Kohana version 2.3 and 3.3, so breaking down your code and building it up for 3.3 would cause more pain and problems than just writing from scratch.

我建议从头开始写一切。 Kohana版本2.3和3.3之间存在巨大差异,因此分解代码并将其构建为3.3会导致更多的痛苦和问题,而不仅仅是从头开始编写。

You could also just keep your existing project at Kohana 2.x and revert to Kohana 3.x for any future projects. As long as your projects work without any problems, there is no reason to switch to 3.x.

您也可以将现有项目保留在Kohana 2.x中,并在以后的任何项目中恢复为Kohana 3.x.只要您的项目没有任何问题,就没有理由切换到3.x.

For more information on Kohana 2.x vs 3.x, see this article: http://kerkness.ca/kowiki/doku.php?id=what_version_of_kohana_should_i_use

有关Kohana 2.x vs 3.x的更多信息,请参阅此文章:http://kerkness.ca/kowiki/doku.php?id = what_version_of_kohana_should_i_use

#2


1  

This is potentially a very broad question and it is really hard to provide an answer that would be the most suitable for your project considering we know very little about it.

这可能是一个非常广泛的问题,考虑到我们对它的了解很少,很难提供最适合您项目的答案。

>10k lines isn't all that much to be honest and taking into account all the benefits that the new Kohana version may provide you it is definietly worth considering, but if the current project is already well designed and written simple adaptation to Kohana 3.3 might be enough.

> 10k线并不是那么说实话,并考虑到新Kohana版本可能为您提供的所有好处,它绝对值得考虑,但如果当前项目已经设计良好并且编写简单适应Kohana 3.3可能足够。

You may want to refer to Kohana guide providing details on what's changed between versions starting with 2.x -> 3.0, through 3.0 -> 3.1, 3.1 -> 3.2 ending with the latest migration guide to get an idea what you'll be dealing with when adapting.

您可能需要参考Kohana指南,提供有关从2.x - > 3.0,到3.0 - > 3.1,3.1 - > 3.2之间的版本之间的更改的详细信息,以最新的迁移指南结束,以了解您将要处理的内容与适应时。

On the other hand it might be that the rewrite could be quicker to complete. It is very hard to judge and decide.

另一方面,重写可能会更快完成。很难判断和决定。

#1


2  

I would recommend writing everything from scratch. There is an enormous difference between Kohana version 2.3 and 3.3, so breaking down your code and building it up for 3.3 would cause more pain and problems than just writing from scratch.

我建议从头开始写一切。 Kohana版本2.3和3.3之间存在巨大差异,因此分解代码并将其构建为3.3会导致更多的痛苦和问题,而不仅仅是从头开始编写。

You could also just keep your existing project at Kohana 2.x and revert to Kohana 3.x for any future projects. As long as your projects work without any problems, there is no reason to switch to 3.x.

您也可以将现有项目保留在Kohana 2.x中,并在以后的任何项目中恢复为Kohana 3.x.只要您的项目没有任何问题,就没有理由切换到3.x.

For more information on Kohana 2.x vs 3.x, see this article: http://kerkness.ca/kowiki/doku.php?id=what_version_of_kohana_should_i_use

有关Kohana 2.x vs 3.x的更多信息,请参阅此文章:http://kerkness.ca/kowiki/doku.php?id = what_version_of_kohana_should_i_use

#2


1  

This is potentially a very broad question and it is really hard to provide an answer that would be the most suitable for your project considering we know very little about it.

这可能是一个非常广泛的问题,考虑到我们对它的了解很少,很难提供最适合您项目的答案。

>10k lines isn't all that much to be honest and taking into account all the benefits that the new Kohana version may provide you it is definietly worth considering, but if the current project is already well designed and written simple adaptation to Kohana 3.3 might be enough.

> 10k线并不是那么说实话,并考虑到新Kohana版本可能为您提供的所有好处,它绝对值得考虑,但如果当前项目已经设计良好并且编写简单适应Kohana 3.3可能足够。

You may want to refer to Kohana guide providing details on what's changed between versions starting with 2.x -> 3.0, through 3.0 -> 3.1, 3.1 -> 3.2 ending with the latest migration guide to get an idea what you'll be dealing with when adapting.

您可能需要参考Kohana指南,提供有关从2.x - > 3.0,到3.0 - > 3.1,3.1 - > 3.2之间的版本之间的更改的详细信息,以最新的迁移指南结束,以了解您将要处理的内容与适应时。

On the other hand it might be that the rewrite could be quicker to complete. It is very hard to judge and decide.

另一方面,重写可能会更快完成。很难判断和决定。