2017 © Pedro Peláez
 

library simparse

simple configs parser

image

muradg/simparse

simple configs parser

  • Sunday, March 6, 2016
  • by Muradg
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SimParse

Example

Firstly, we need to create a folder to store configurations. Then, when we initialize the object, the first parameter is passed the directory where the files will be stored configurations. The second parameter, specify a file type. (Default php), (*1)

    $config = new SimParse\Config('configs', 'php');

When an object is created, we can expand the library by adding your adapters by addAdapter:, (*2)

    $config->addAdapter('serialize', 'SimParse\Adapters\SerializeAdapter')

To get the data from the file, use the function get(). For example, to retrieve data from configs/config.php file we write the following:, (*3)

    [
        'mysql' => [
            'host'  => 'default',
            'user'  => 'default',
            'db'    => 'default',
        ]
    ]

To get the value of db, the code will be as follows:, (*4)

    $config->get('config.mysql.db');

The Versions

06/03 2016

dev-master

9999999-dev

simple configs parser

  Sources   Download

MIT

by Avatar Muradg

01/03 2016

0.1

0.1.0.0

simple configs parser

  Sources   Download

MIT

by Avatar Muradg