2022-07-21 1147次浏览

Version 1.2.0 of Yii console package was tagged. This version adds an ability to configure defaults for yii serve command that starts built-in development web server. It could be done via params.php of the console:

return [
    'yiisoft/yii-console' => [
        // ...
        'serve' => [
            'appRootPath' => null,
            'options' => [
                'address' => '127.0.0.1',
                'port' => '8080',
                'docroot' => 'public',
                'router' => 'public/index.php',
            ],
        ],
    ],