From cbcb0f52ad23602b951c2c9985e919316e6dd6c8 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Tue, 3 Feb 2015 09:54:41 -0800 Subject: [PATCH 1/4] Moving Files around for CakePHP 3.0 Signed-off-by: Justin Yost --- {Console => src/Console}/Command/ConfigReadShell.php | 0 {Test => tests}/Case/Console/Command/ConfigReadShellTest.php | 0 {Test => tests}/Fixture/.gitkeep | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {Console => src/Console}/Command/ConfigReadShell.php (100%) rename {Test => tests}/Case/Console/Command/ConfigReadShellTest.php (100%) rename {Test => tests}/Fixture/.gitkeep (100%) diff --git a/Console/Command/ConfigReadShell.php b/src/Console/Command/ConfigReadShell.php similarity index 100% rename from Console/Command/ConfigReadShell.php rename to src/Console/Command/ConfigReadShell.php diff --git a/Test/Case/Console/Command/ConfigReadShellTest.php b/tests/Case/Console/Command/ConfigReadShellTest.php similarity index 100% rename from Test/Case/Console/Command/ConfigReadShellTest.php rename to tests/Case/Console/Command/ConfigReadShellTest.php diff --git a/Test/Fixture/.gitkeep b/tests/Fixture/.gitkeep similarity index 100% rename from Test/Fixture/.gitkeep rename to tests/Fixture/.gitkeep From 753975fc79578578cc6ec30c0cf92c3d9a42271a Mon Sep 17 00:00:00 2001 From: Brian Porter Date: Wed, 25 Feb 2015 08:39:41 -0600 Subject: [PATCH 2/4] Corrects the README to be accurate for Cake 3. --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 20ca65b..e24b8c1 100644 --- a/README.md +++ b/README.md @@ -2,37 +2,36 @@ A CakePHP plugin that provides a Shell to read an app's Configure vars from the command line. -* For the Cake 2.x version of this plugin, please use the repo's `master` branch. -* For the Cake 1.3 version, use the `1.3` branch. (Note: we don't expect to actively maintain the 1.3 version. It's here because it started life as a 1.3 Shell.) + +* This is the Cake 3.x version of the plugin, which exists on the `master` branch and is tracked by the `3.*` semver. +* For the Cake 2.x version of this plugin, please use the repo's `cake-2.x` branch. (semver `2.*`) +* For the Cake 1.3 version, use the `cake-1.3` branch. (semver `1.*`) **Note:** we don't expect to actively maintain the 1.3 version. It's here because the project started life as a 1.3 Shell. ## Requirements -* CakePHP 2.5.0+ +* CakePHP 3.0.0+ * PHP 5.4.19+ ## Installation -`composer require loadsys/config-read:2.*` - -or +`composer require loadsys/config-read:3.*` -`git submodule add https://github.com/loadsys/CakePHP-ConfigReadShell.git Plugin/ConfigRead` ## Usage ```shell $ cd path/to/app/ -$ ./lib/Console/cake config_read.config_read Key.Name +$ ./bin/cake config_read.config_read Key.Name 'foo' ``` ### Format as a bash variable definition ```shell -$ ./lib/Console/cake config_read.config_read Key.Name Second.Key +$ ./bin/cake config_read.config_read Key.Name Second.Key KEY_NAME='foo' SECOND_KEY_FIRST='bar' SECOND_KEY_SECOND='baz' @@ -42,7 +41,7 @@ SECOND_KEY_THIRD='42' Note that this format is automatically used whenever more than one key is returned. For example, if you request a key that contains an array, all values in the array will be returned sequentially. Alternatively, if you pass multiple keys on the command line, they will be returned. The format can also be forced using the `-b` or `--bash` command line switch: ```shell -$ ./lib/Console/cake config_read.config_read -b Key.Name +$ ./bin/cake config_read.config_read -b Key.Name KEY_NAME='foo' ``` From bc3785e0e77c515b20bf41c13eb3c562e83718ab Mon Sep 17 00:00:00 2001 From: Brian Porter Date: Tue, 31 Mar 2015 16:53:31 -0500 Subject: [PATCH 3/4] Speculative Cake 3 compatibility. --- README.md | 2 +- src/{Console/Command => Shell}/ConfigReadShell.php | 5 ++++- .../Case/{Console/Command => Shell}/ConfigReadShellTest.php | 0 3 files changed, 5 insertions(+), 2 deletions(-) rename src/{Console/Command => Shell}/ConfigReadShell.php (98%) rename tests/Case/{Console/Command => Shell}/ConfigReadShellTest.php (100%) diff --git a/README.md b/README.md index e24b8c1..4c1ee6a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A CakePHP plugin that provides a Shell to read an app's Configure vars from the ## Installation -`composer require loadsys/config-read:3.*` +`composer require loadsys/config-read:~3.0` diff --git a/src/Console/Command/ConfigReadShell.php b/src/Shell/ConfigReadShell.php similarity index 98% rename from src/Console/Command/ConfigReadShell.php rename to src/Shell/ConfigReadShell.php index e375f90..34fe571 100644 --- a/src/Console/Command/ConfigReadShell.php +++ b/src/Shell/ConfigReadShell.php @@ -4,8 +4,11 @@ * * @package App.Console.Command */ +namespace ConfigRead\Shell; + +use Cake\Console\Shell; +use Cake\Core\Configure; -App::uses('Shell', 'Console'); /** * ConfigReadShell class. diff --git a/tests/Case/Console/Command/ConfigReadShellTest.php b/tests/Case/Shell/ConfigReadShellTest.php similarity index 100% rename from tests/Case/Console/Command/ConfigReadShellTest.php rename to tests/Case/Shell/ConfigReadShellTest.php From 1a46708444880a3de99916b9fc57be1175d3dda1 Mon Sep 17 00:00:00 2001 From: Brian Porter Date: Tue, 31 Mar 2015 16:55:45 -0500 Subject: [PATCH 4/4] Simplify usage example syntax. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c1ee6a..f9375ac 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,14 @@ A CakePHP plugin that provides a Shell to read an app's Configure vars from the ```shell $ cd path/to/app/ -$ ./bin/cake config_read.config_read Key.Name +$ ./bin/cake ConfigRead Key.Name 'foo' ``` ### Format as a bash variable definition ```shell -$ ./bin/cake config_read.config_read Key.Name Second.Key +$ ./bin/cake ConfigRead Key.Name Second.Key KEY_NAME='foo' SECOND_KEY_FIRST='bar' SECOND_KEY_SECOND='baz' @@ -41,7 +41,7 @@ SECOND_KEY_THIRD='42' Note that this format is automatically used whenever more than one key is returned. For example, if you request a key that contains an array, all values in the array will be returned sequentially. Alternatively, if you pass multiple keys on the command line, they will be returned. The format can also be forced using the `-b` or `--bash` command line switch: ```shell -$ ./bin/cake config_read.config_read -b Key.Name +$ ./bin/cake ConfigRead -b Key.Name KEY_NAME='foo' ```