knyga/dotconfig

Wraps input config file with simple interface with get method, wich accepts doted request string (->get('config.ttl'))

Installs: 33

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:application

dev-master / 1.0.x-dev 2014-02-17 12:10 UTC

This package is not auto-updated.

Last update: 2024-04-27 13:10:09 UTC


README

Wraps input config file with simple interface with get method, wich accepts doted request string (->get('config.ttl'))

Example

Code:

<?php

use DotConfig\Config;

$config = require __DIR__.'/Resources/files/correct_config.php';
$this->config = new Config($config);
$ttl = $this->config->get('client.cache.ttl');

Input file:

<?php

return array(
    "client" => array(
        "cache" => array(
            "ttl" => 3600,
        )
    )
);

Installation via Composer

  • Install Composer to your project root:

    curl -sS https://getcomposer.org/installer | php
  • Add a composer.json file to your project:

    {
      "require" {
        "knyga/dotconfig": "1.0.*@dev"
      }
    }
  • Run the Composer installer:

    php composer.phar install

License

DotConfig is licensed under the MIT license.

Sobit Akhmedov sobit.akhmedov@gmail.com

Oleksandr Knyga oleksandrknyga@gmail.com