2017 © Pedro Peláez
 

library config-reader

Ini config reader for PHP 5.3

image

jayzeng/config-reader

Ini config reader for PHP 5.3

  • Monday, September 16, 2013
  • by jayzeng
  • Repository
  • 1 Watchers
  • 2 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Config Reader to parse ini files

Latest Stable VersionTotal DownloadsBuild Status, (*1)

Project website: (http://jayzeng.github.com/config-reader/), (*2)

Usage:

config.ini, (*3)

[production]
username = 'jayzeng'
password = 'password'

[whitelistIps]
ip[] = 127.0.0.1
ip[] = 192.168.0.1/24
use ConfigReader\Ini as IniReader;

// read a specific rule
$username = IniReader::factory( __DIR__ . DIRECTORY_SEPARATOR . 'config.ini' )
                    ->setLabel('production')
                    ->getLabel('username');
                    // returns jayzeng

Read all rules within a label section, (*4)

use ConfigReader\Ini as IniReader;

// read all rules within production section
$prodConfig = IniReader::factory( __DIR__ . DIRECTORY_SEPARATOR . 'config.ini' )
                    ->setLabel('production')
                    ->toArray();

// returns
// array
// 'username' => 'jayzeng'
// 'password' => 'password'

// You can also populate an array
$ips = IniReader::factory( __DIR__ . DIRECTORY_SEPARATOR . 'config.ini' )
                    ->setLabel('whitelistIps')
                    ->toArray();
// returns
// array
// 'ip' => array ( '127.0.0.1', '192.168.0.1/24' );

Issues & Development

How to release new version?

  • RELEASE_VERSION - version number
  • RELEASE_MESSAGE - release message
make release RELEASE_VERSION="0.1" RELEASE_MESSAGE="v0.1 is released"

Author:

Jay Zeng, e-mail: jayzeng@jay-zeng.com, (*5)

Bitdeli Badge, (*6)

The Versions

16/09 2013

dev-master

9999999-dev https://github.com/jayzeng/config-reader

Ini config reader for PHP 5.3

  Sources   Download

MIT

The Requires

 

parser ini config reader

03/02 2013

v0.1

0.1.0.0 https://github.com/jayzeng/config-reader

Ini config reader for PHP 5.3

  Sources   Download

MIT

The Requires

 

parser ini config reader