Changing default environment in Laravel 4

前端 未结 6 1803
我在风中等你
我在风中等你 2021-02-02 00:35

In Laravel 4 the default configuration environment is \'production\'. This means that if you run an artisan command without the --env option, it assumes the product

6条回答
  •  长发绾君心
    2021-02-02 01:06

    Thanks Antonio for prompting me to reconsider domain detection.

    $env = $app->detectEnvironment(array(
    (
        // Empty string is to set development as the default environment for 
        // artisan commands.
        'development' => array('dev.foo.com', ''),
        'test' => array('test.foo.com'),
        'production' => array('www.foo.com', 'foo.com'),
    ));
    

    Adding '' as a development domain effectively sets development as the default environment for artisan commands, presumably because the domain name is blank when the application is invoked from the command line. I tested and it seems anything == false will work. I also verified this does not interfere with the detection of the production or testing environments.

提交回复
热议问题