PHP code example of josegonzalez / cakephp-environments

1. Go to this page and download the library: Download josegonzalez/cakephp-environments library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

josegonzalez / cakephp-environments example snippets


Plugin::load('Josegonzalez/Environments');


use Josegonzalez\Environments\Environment;

 DS . 'staging.php';



Josegonzalez\Environments\Environment::configure($name, $params, $config = null, $callable = null);

    \Josegonzalez\Environments\Environment::configure(
        'development',
        true,
        ['debug' => true]
    );
    

    \Josegonzalez\Environments\Environment::configure(
        'development',
        [
        	'some_function' => 'aValueForThisCheck',
        	'another_function' => 'aDifferentValueForThisCheck',
    	]
    );
    

    \Josegonzalez\Environments\Environment::configure(
        'octo_development',
        [
        	'SERVER_NAME' => 'octo-example.dev',
        ]
    );

    \Josegonzalez\Environments\Environment::configure(
        'bear_development',
        [
        	'SERVER_NAME' => 'bear-example.dev',
        ]
    );

    \Josegonzalez\Environments\Environment::configure(
        'development',
        [
    		'CAKE_ENV' => 'development',
    	]
    );