2017 © Pedro Peláez
 

library kengai

Configuration tool for your PHP applications

image

jcambien/kengai

Configuration tool for your PHP applications

  • Friday, July 18, 2014
  • by jcambien
  • Repository
  • 3 Watchers
  • 19 Stars
  • 233 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Kengai

Kengai, (*1)

Kengai is a simple but powerful configuration tool for your PHP applications. Anybody is welcome to help and contribute to this project., (*2)

About this project

The idea is simple : - Manage configurations from any formats with a tree structure (YAML, JSON, INI, etc.) in a simple and optimized way. - All data are stored in a common tree ordered by namespaces. - The possibility to use any cache system (like APC). - Event system for advanced use cases, powered by the Symfony 2 event dispatcher component., (*3)

Basics

Here is a example of a basic usage:, (*4)

<?php

use Kengai\Manager as Kengai;
use Kengai\SourceReader\YAML;
use Kengai\SourceReader\JSON;

// Create a Kengai manager instance
$kengai = new Kengai();

// Import your configuration files
$kengai->add(new YAML('myconfig.yml', 'myconfig'));

// Example of JSON support
$kengai->add(new JSON('composer.json', 'composer'));

// Fetch data
$kengai->fetch();

As you can see in this example, all sources are registered with the add() method before fetch() call. When all sources are registered, you can use fetch() to proceed the importing process. After this, you can not use add() anymore! In the case of a cache manager is registered, the importing process will first verify the cache freshness from your cache manager, then just restore it or reload all sources if needed., (*5)

Here's is a configuration reading example :, (*6)

$bar = $kengai->get('foo.bar');

var_dump($bar);

Cache support

You can use any cache system by using CacheManagerInterface :, (*7)

<?php

use Kengai\Manager as Kengai;
use Kengai\SourceReader\YAML;
use Kengai\CacheManager\APC;

// Create a Kengai manager instance with APC support
$kengai = new Kengai(new APC());

...

// Fetch data
$kengai->fetch();

The Versions

18/07 2014

dev-master

9999999-dev http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration config yaml

18/07 2014

1.1.3

1.1.3.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration config yaml

12/07 2014

1.1.2

1.1.2.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration config yaml

03/12 2013

1.1.1

1.1.1.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration config yaml

27/05 2013

1.1.0

1.1.0.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration config yaml

13/05 2013

1.0.3

1.0.3.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration yaml

25/01 2013

1.0.2

1.0.2.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration yaml

29/11 2012

1.0.1

1.0.1.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration yaml

08/11 2012

1.0.0

1.0.0.0 http://kengai.github.com

Configuration tool for your PHP applications

  Sources   Download

MIT

The Requires

 

by Julien Cambien

php json configuration yaml