2017 © Pedro Peláez
 

library dez-configuration

DezPHP - Config

image

dez-php/dez-configuration

DezPHP - Config

  • Thursday, April 14, 2016
  • by dez
  • Repository
  • 1 Watchers
  • 0 Stars
  • 163 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Dez Config Component

Usage

examples

<?php

include_once '../vendor/autoload.php';

$config     = new Dez\Config\Adapter\NativeArray('./app.php');

$config->get('app')->get('path')->get('static');
$config['app']['path']['base'];
$config->app->path->base;
$config->app['path']->get('static');

$appJson    = $config['app']->toJSON();
$pathArray  = $config->app['path']->toArray();

using adapters

<?php

include_once '../vendor/autoload.php';

$config     = new Dez\Config\Adapter\NativeArray('./_config.php');
$configJson = new Dez\Config\Adapter\Json('./_config.json');

using static method factory

<?php

use Dez\Config\Config;
include_once '../vendor/autoload.php';

// from ini file
$config1    = Config::factory('./_config.ini');
// from native php file
$config2    = Config::factory('./_config.php');
// from json file
$config3    = Config::factory('./_config.json');
// from native php array
$config4    = Config::factory([
    'app' => [
        'site'  => 'test.com',
        'path'  => [
            'static'    => '/assets',
            'base'      => '/'
        ]
    ]
]);

merge config objects

<?php

use Dez\Config\Config;
include_once '../vendor/autoload.php';

$config         = new Dez\Config\Adapter\NativeArray('./connection.php');
$configIni      = Config::factory('./app.ini');
$configJson     = new Dez\Config\Adapter\Json('./site-setting.json');

$globalConfig   = $config->merge($configIni)->merge($configJson);

extra methods

<?php

include_once '../vendor/autoload.php';

$config         = new Dez\Config\Adapter\NativeArray('./connection.php');

$config->toArray();
$config->toJSON();
$config->toObject();

The Versions

14/04 2016

dev-master

9999999-dev

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

14/04 2016

v1.3.0

1.3.0.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

15/03 2016

v1.2.0

1.2.0.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

25/11 2015

v1.1.2

1.1.2.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

25/11 2015

v1.1.1

1.1.1.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

25/11 2015

v1.1.0

1.1.0.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config

01/09 2015

v1.0.0

1.0.0.0

DezPHP - Config

  Sources   Download

MIT

The Requires

  • php >=5.5

 

config php config dez-php config dez-config