Laravel 工匠优化不创建引导程序/编译
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23018447/
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
Laravel artisan optimize not creating bootstrap/compiled
提问by Benubird
I used to have a bootstrap/compiled.php
file. Then I accidentally deleted it, and because for some reason it was in .gitignore, I don't have another copy of it. How do I get it back?
我曾经有一个bootstrap/compiled.php
文件。然后我不小心删除了它,由于某种原因它在 .gitignore 中,我没有它的另一个副本。我如何取回它?
I tried running compose dump-autoload
and php artisan optimize
, neither of these generated the file. Where does it come from? How do I produce it?
我尝试运行compose dump-autoload
和php artisan optimize
,这些都没有生成文件。它从何而来?我如何生产它?
回答by Antonio Carlos Ribeiro
Laravel 4.1+ does not create bootstrap/compiled.php
on development boxes anymore, only in 'production'. Actually Laravel checks if debug mode is on
if it is, it will not generate the compiled.php.
Laravel 4.1+ 不再bootstrap/compiled.php
在开发盒上创建,只在“生产”中创建。实际上 Laravel 会检查调试模式on
是否是,如果是,它不会生成compiled.php。
But you can:
但是你可以:
php artisan optimize --force
To force its creation.
强制其创建。
回答by Farid Movsumov
Switch debug mode to false in app/config/app.phpand run your command again.
在app/config/app.php中将调试模式切换为 false并再次运行您的命令。
'debug' => false,