Bre*_*ing 23 php laravel laravel-4
我有一个全新的Laravel.跑步时,php artisan migrate:refresh
我收到一条消息说Application In Production! Do you really wish to run this command?'
我知道这是4.2中的更新,但我无法弄清楚如何将其关闭.
我在源代码中发现,Illuminate\Console\ConfirmableTrait
如果测试通过,它来自并运行:if ($this->getLaravel()->environment() == 'production')
我不确定为什么它认为我在制作中.我从不设置任何环境.这是我目前仍在使用的默认环境检测.
$env = $app->detectEnvironment(array(
'local' => array('homestead')
));
Run Code Online (Sandbox Code Playgroud)
此外,如果我将生产环境设置为不是我的机器的主机名,我仍然有同样的问题.
The*_*pha 33
只需为与给定环境匹配的主机指定机器名称,然后laravel
将自动检测环境(默认为production
),例如:
$env = $app->detectEnvironment(array(
//'local' => array('homestead'),
'local' => array('*.dev', gethostname()),
'production' => array('*.com', '*.net', 'www.somedomain.com')
));
Run Code Online (Sandbox Code Playgroud)
将您的环境设置为生产以外的其他方式是正确的方法. 看到接受的答案.
但是,如果您正在寻找可以使用的快速修复(在UNIXoid环境中):
yes | php artisan migrate:refresh
Run Code Online (Sandbox Code Playgroud)
所有这一切都是向程序发送一个"y"流,就像你在提示时按下"y"一样.
我觉得这比一般工艺--force
指令支持力量要好一些.