2017 © Pedro Peláez
 

cakephp-plugin cakeenv

Environment switch plugin for CakePHP

image

guenbakku/cakeenv

Environment switch plugin for CakePHP

  • Sunday, July 9, 2017
  • by guenbakku
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 43 % Grown

The README.md

Cakeenv

Installation

You can install this plugin into your CakePHP application using composer., (*1)

The recommended way to install composer packages is:, (*2)

composer require guenbakku/cakeenv

Usage

1/ Load plugin into CakePHP

Open and modify file config/bootstrap.php like following:, (*3)

Before:, (*4)

~~~ php try { Configure::config('default', new PhpConfig()); Configure::load('app', 'default', false); } catch (\Exception $e) { exit($e->getMessage() . "\n"); }, (*5)


After: ~~~ php try { Configure::config('default', new PhpConfig()); Plugin::load('Guenbakku/Cakeenv', ['bootstrap' => false, 'routes' => false]); Guenbakku\Cakeenv\Environment::load('app', 'default', false); } catch (\Exception $e) { exit($e->getMessage() . "\n"); }

2/ Create directory for containing each environment's app.php

Note:
Name of each environment directory can be set to anything you want., (*6)

config
    |--- environments
        |--- development
            |--- app.php
        |--- production
            |--- app.php
        |--- stagging
            |--- app.php
        |--- env

3/ Switch to environment you want

Open file config/environments/env, set environment name you want in the first line and save it. That's all., (*7)

Example:, (*8)

development

Development

Note:
Following is the memo for developing this plugin. End-user can skip this section., (*9)

```bash, (*10)

1. Build docker image for developing (first time only)

$ docker-compose build, (*11)

2. Composer installing (first time only)

$ docker-compose run --rm php composer install, (*12)

3. Execute phpunit

$ docker-compose run --rm php vendor/bin/phpunit, (*13)

The Versions

09/07 2017

dev-master

9999999-dev

Environment switch plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

09/07 2017

0.1.1

0.1.1.0

Environment switch plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

09/07 2017

dev-develop

dev-develop

Environment switch plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

25/06 2017

0.1.0

0.1.0.0

Environment switch plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

25/06 2017

0.0.1

0.0.1.0

Environment switch plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires