eclogue/ben

php config

Maintainers

Details

github.com/eclogue/ben

Source

Issues

1.0.0 2017-07-14 07:18 UTC

This package is not auto-updated.

Last update: 2024-04-26 14:51:01 UTC


README

Ben is the name of my old buffalo.This project is designed to manage the configuration file.

#usage use Ben\Config;

  • Config::set($key, $val = '')

    $key string or array if $key use . connection, it will be considered as get value from multi-dimensional arrays by index. For example:

    Config::set('test.foo'); // look like $config['test']['foo'];
    

    if $key is array it will be merged

  • Config::get($key)

    $key string support use . connector to search multi-dimensional arrays. For example: Config::get('test.foo')

  • load configure file from path Config::load($path, $defaul = 'default.php')

    Config::load('./config/develop.php');
    
  • support auto load by command line arguments

        // set path
        Config::load('./config');
        // run script
        php demo.php --env staging