From d2840ad8fc1f3abe08f1a94274a3181dfed33fc1 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 2 Sep 2014 23:17:50 -0400 Subject: [PATCH 1/6] Added `yii\composer\Installer::postCreateProject()` and modified the syntax of calling installer methods in composer.json [skip ci] --- composer.json | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 0966855..ba8cfd0 100644 --- a/composer.json +++ b/composer.json @@ -25,25 +25,26 @@ "yiisoft/yii2-gii": "*", "yiisoft/yii2-faker": "*" }, - "scripts": { - "post-create-project-cmd": [ - "yii\\composer\\Installer::setPermission", - "yii\\composer\\Installer::generateCookieValidationKey" - ] - }, "config": { "process-timeout": 1800 }, - "extra": { - "writable": [ - "runtime", - "web/assets" - ], - "executable": [ - "yii" - ], - "config": [ - "config/web.php" + "scripts": { + "post-create-project-cmd": [ + "yii\\composer\\Installer::postCreateProject" ] + }, + "extra": { + "yii\\composer\\Installer::postCreateProject": { + "setPermission": [ + { + "runtime": "0777", + "web/assets": "0777", + "yii": "0755" + } + ], + "generateCookieValidationKey": [ + "config/web.php" + ] + } } } From a6b38ddef6b9354463aecc491fad0cb6ef8336a5 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Wed, 3 Sep 2014 10:02:31 -0400 Subject: [PATCH 2/6] cleaned up the key so that it can be filled up with a random key automatically when installed. --- config/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/web.php b/config/web.php index 4fde1b6..0b4c752 100644 --- a/config/web.php +++ b/config/web.php @@ -9,7 +9,7 @@ $config = [ 'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation - 'cookieValidationKey' => 'thisIsAKey', + 'cookieValidationKey' => '', ], 'cache' => [ 'class' => 'yii\caching\FileCache', From f1df2e43363b70d3b746c3cfafa6d4551f9fcd70 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 4 Sep 2014 03:27:13 +0400 Subject: [PATCH 3/6] Fixes #4914 --- commands/HelloController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/commands/HelloController.php b/commands/HelloController.php index 86ab8b8..9314fe7 100644 --- a/commands/HelloController.php +++ b/commands/HelloController.php @@ -27,4 +27,20 @@ class HelloController extends Controller { echo $message . "\n"; } + + public function actionTest() + { + echo 'Test?'; + } + +// public function getDescription($actionID = null) +// { +// return "I'm custom description for $actionID!"; +// } + + + public function getHelp($actionID = null) + { + return "I'm custom help for $actionID!"; + } } From 8017996cccc7f3f55bc5f21738ab89c542a7759f Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 4 Sep 2014 12:13:28 +0400 Subject: [PATCH 4/6] Reverted accidentally edited HelloController --- commands/HelloController.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/commands/HelloController.php b/commands/HelloController.php index 9314fe7..86ab8b8 100644 --- a/commands/HelloController.php +++ b/commands/HelloController.php @@ -27,20 +27,4 @@ class HelloController extends Controller { echo $message . "\n"; } - - public function actionTest() - { - echo 'Test?'; - } - -// public function getDescription($actionID = null) -// { -// return "I'm custom description for $actionID!"; -// } - - - public function getHelp($actionID = null) - { - return "I'm custom help for $actionID!"; - } } From cc50af25ec39fd4ac3955ea599816279a76623bd Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 14 Sep 2014 14:15:16 -0400 Subject: [PATCH 5/6] Finished console Gii. --- config/console.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/console.php b/config/console.php index 85297b3..31ed9c7 100644 --- a/config/console.php +++ b/config/console.php @@ -8,8 +8,11 @@ $db = require(__DIR__ . '/db.php'); return [ 'id' => 'basic-console', 'basePath' => dirname(__DIR__), - 'bootstrap' => ['log'], + 'bootstrap' => ['log', 'gii'], 'controllerNamespace' => 'app\commands', + 'modules' => [ + 'gii' => 'yii\gii\Module', + ], 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', From 7411e65c5ebf1a7295a8f2b7b7db971976ca2119 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 16 Sep 2014 16:28:49 -0400 Subject: [PATCH 6/6] reverted a prior change. --- config/web.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/web.php b/config/web.php index 0b4c752..1632a5a 100644 --- a/config/web.php +++ b/config/web.php @@ -38,10 +38,6 @@ $config = [ ], ], 'db' => require(__DIR__ . '/db.php'), - 'urlManager' => [ - 'enablePrettyUrl' => true, - 'showScriptName' => false, - ], ], 'params' => $params, ];