From f60f7647c57d7ec535812c77fe34cc7b9020c403 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Pan Date: Tue, 8 Sep 2015 23:18:39 +0200 Subject: [PATCH] remove gii module in production --- config/console.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/config/console.php b/config/console.php index 31ed9c7..e5315b9 100644 --- a/config/console.php +++ b/config/console.php @@ -5,14 +5,11 @@ Yii::setAlias('@tests', dirname(__DIR__) . '/tests'); $params = require(__DIR__ . '/params.php'); $db = require(__DIR__ . '/db.php'); -return [ +$config = [ 'id' => 'basic-console', 'basePath' => dirname(__DIR__), - 'bootstrap' => ['log', 'gii'], + 'bootstrap' => ['log'], 'controllerNamespace' => 'app\commands', - 'modules' => [ - 'gii' => 'yii\gii\Module', - ], 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', @@ -29,3 +26,11 @@ return [ ], 'params' => $params, ]; + +if (YII_ENV_DEV) { + // configuration adjustments for 'dev' environment + $config['bootstrap'][] = 'gii'; + $config['modules']['gii'] = [ + 'class' => 'yii\gii\Module', + ]; +}