开发 Laravel 3 和 Laravel 4

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14540465/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 07:31:44  来源:igfitidea点击:

developing Laravel 3 and laravel 4

phpframeworkslaravellaravel-4laravel-3

提问by mrakodol

Does application build on Laravel 3 work on Laravel 4?

在 Laravel 3 上构建的应用程序可以在 Laravel 4 上运行吗?

In few days ago I found Laravel and now I try to learn it. Am I losing time learning Laravel 3 when Laravel 4 is coming? Is this a same with some addons in LV4? And would my application build in LV3 work in LV4?
Where and how to start learning LV4?

几天前我发现了 Laravel,现在我尝试学习它。当 Laravel 4 到来时,我是不是在浪费时间学习 Laravel 3?这与 LV4 中的某些插件相同吗?我在 LV3 中构建的应用程序是否可以在 LV4 中运行?
从哪里以及如何开始学习 LV4?

回答by Dries Vints

Laravel 4 is currently in beta 1 with beta 2 coming this or probably next week. To answer your question directly: yes your Laravel 3 (L3) application will break in Laravel 4 (L4) because L4 differs in quite a few points from L3. But L4 was designed with migrating from L3 installs in mind so you definitely don't have to rewrite your entire application. You probably only need to update some routes, functions and implement some new ways L4 handles certain key aspects. Like others stated here, a migration guide isn't available yet but you can bet that when L4 gets released a lot of tutorials and guides will be made available.

Laravel 4 目前处于 beta 1,beta 2 将于本周或下周发布。直接回答您的问题:是的,您的 Laravel 3 (L3) 应用程序将在 Laravel 4 (L4) 中中断,因为 L4 与 L3 有很多不同之处。但是 L4 的设计考虑了从 L3 安装迁移,因此您绝对不必重写整个应用程序。您可能只需要更新一些路由、函数并实现 L4 处理某些关键方面的一些新方法。与此处所述的其他人一样,迁移指南尚不可用,但您可以打赌,当 L4 发布时,将提供大量教程和指南。

You're not losing time learning L3 since much of L4 is still the same as L3. The docs of L4 will help you transfer from L3 to L4. Taylor said (and I agree) that you shouldn't wait until L4 gets finished. If you want to build an app and release it for production soon just go with L3 and migrate later on.

您不会浪费时间学习 L3,因为 L4 的大部分内容仍与 L3 相同。L4 的文档将帮助您从 L3 转移到 L4。泰勒说(我同意)你不应该等到 L4 完成。如果您想构建一个应用程序并尽快将其发布到生产环境中,只需使用 L3 并稍后迁移。

The way L4 implements bundles differs from L3. L4 uses composer to install dependencies into the framework. You can always still use bundles directly in the app but they probably need to be updated to work along nicely with the updates in L4.

L4 实现捆绑的方式与 L3 不同。L4 使用 composer 将依赖项安装到框架中。您仍然可以直接在应用程序中使用捆绑包,但它们可能需要更新才能与 L4 中的更新完美配合。

To start learning L4 the documentation is a great way to do so. You won't learn everything but work isn't done on the docs either. There's more to come as more betas get released.

要开始学习 L4,文档是一个很好的方法。您不会学到所有东西,但也不会在文档上完成工作。随着更多测试版的发布,还会有更多内容发布。

If you want to learn more about L4 here are a few nice tutorials to get you started:

如果您想了解有关 L4 的更多信息,这里有一些不错的教程可以帮助您入门:

There's much more out there but this should get you started :)

还有更多的东西,但这应该让你开始:)

回答by juco

This should hopefully answer all of your questions: http://four.laravel.com/

这应该能回答你所有的问题:http: //four.laravel.com/

I haven't seen a migration guide yet, but then I haven't looked too hard. I'm sure if there isn't one yet, there will be soon

我还没有看到迁移指南,但我并没有看得太认真。我敢肯定,如果还没有,很快就会有的