Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CakePHP 3.0 #5

Merged
merged 4 commits into from
Apr 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.