diff --git a/README.md b/README.md index 20ca65b..f9375ac 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.0` -`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 ConfigRead Key.Name 'foo' ``` ### Format as a bash variable definition ```shell -$ ./lib/Console/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' @@ -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 ConfigRead -b Key.Name KEY_NAME='foo' ``` diff --git a/Console/Command/ConfigReadShell.php b/src/Shell/ConfigReadShell.php similarity index 98% rename from Console/Command/ConfigReadShell.php rename to src/Shell/ConfigReadShell.php index e375f90..34fe571 100644 --- a/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/Test/Case/Console/Command/ConfigReadShellTest.php b/tests/Case/Shell/ConfigReadShellTest.php similarity index 100% rename from Test/Case/Console/Command/ConfigReadShellTest.php rename to tests/Case/Shell/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