Laravel 框架大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16967945/
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:54:37  来源:igfitidea点击:

Laravel framework size

laravellaravel-4

提问by gtht90

I just downloaded laravel 4 via composer and i see that the size of the vendor folder 26mb.

我刚刚通过composer下载了laravel 4,我看到供应商文件夹的大小为26mb。

After i checked all packages inside the vendor folder i saw that most of them have files that aren't needed in a live website, like tests or readme files.

在我检查了 vendor 文件夹中的所有包后,我发现其中的大多数包都包含在实时网站中不需要的文件,例如测试或自述文件。

I must delete those files manually or is there another way?

我必须手动删除这些文件还是有其他方法?

All those extra packages are required by laravel?

laravel 需要所有这些额外的包吗?

Laravel 3 was very simple, that is why i started using, i never thought a new update could be so different.

Laravel 3 非常简单,这就是我开始使用的原因,我从没想过新的更新会如此不同。

回答by Jason Lewis

Depending on how you installed via Composer you'll also have the Git history of each of those dependencies. You can drop the filesize even more by running composer update --prefer-distto instead download archives instead of cloning the repository.

根据您通过 Composer 安装的方式,您还将拥有每个依赖项的 Git 历史记录。您可以通过运行composer update --prefer-dist来代替下载档案而不是克隆存储库来进一步降低文件大小。

In the long run though, disk space isn't exactly expensive in this day and age. I can understand you might be a little concerned about it but you shouldn't worry too much. It doesn't have a huge impact on the overall performance of your application. If you optimize the Composer autoloader with composer dump-autoload -oand run php artisan optimizeto generate a bootstrap/compiled.phpfile you'll still great excellent speed.

但从长远来看,磁盘空间在当今时代并不昂贵。我能理解你可能有点担心,但你不必太担心。它不会对应用程序的整体性能产生巨大影响。如果您优化 Composer 自动加载器composer dump-autoload -o并运行php artisan optimize以生成bootstrap/compiled.php文件,您仍然会获得出色的速度。

In comparison Laravel 3 is very simple. But Laravel 4 has embraced the future and ships with some awesome functionality.

相比之下,Laravel 3 非常简单。但是 Laravel 4 拥抱了未来,并提供了一些很棒的功能。

At the end of the day there is no reason for you to upgrade to Laravel 4 if you don't see the need. You can safely continue to use Laravel 3 as it will be patched for any security vulnerabilities or bugs.

归根结底,如果您认为没有必要,您没有理由升级到 Laravel 4。您可以安全地继续使用 Laravel 3,因为它将针对任何安全漏洞或错误进行修补。

For more information on the number of files, see this forum post.

有关文件数量的更多信息,请参阅此论坛帖子