From c24991daeb10d058e1725413ee113863e0297df2 Mon Sep 17 00:00:00 2001 From: harrysun Date: Wed, 21 Oct 2015 22:23:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A5=E5=8F=A3=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/basic/web/index.php | 7 +++++++ apps/basic/yii | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/apps/basic/web/index.php b/apps/basic/web/index.php index d1e070a..df404ab 100644 --- a/apps/basic/web/index.php +++ b/apps/basic/web/index.php @@ -1,12 +1,19 @@ run(); diff --git a/apps/basic/yii b/apps/basic/yii index b032ebd..851d681 100755 --- a/apps/basic/yii +++ b/apps/basic/yii @@ -11,14 +11,19 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); // fcgi doesn't have STDIN and STDOUT defined by default +// 定义 STDIN 和 STDOUT defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w')); require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php'); +// 引入 console 的 config 文件,并将返回值即配置项放入 $config 变量中 $config = require(__DIR__ . '/config/console.php'); +// new 一个 yii\console\Application 的实例,并执行它的 run 方法 +// 用 $config 作为 yii\console\Application 初始化的参数 $application = new yii\console\Application($config); $exitCode = $application->run(); +// 退出 exit($exitCode);