2017 © Pedro Peláez
 

library config

Koshatul Config Class

image

koshatul/config

Koshatul Config Class

  • Friday, September 23, 2016
  • by Koshatul
  • Repository
  • 1 Watchers
  • 0 Stars
  • 119 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Configuration Class for PHP

A Configuration class for PHP for keeping configuration items separate from repositories or incorporating config into repositories., (*1)

Build Status Latest Stable Version Total Downloads, (*2)

Installation

Use Composer to install the package:, (*3)

Add the following to your composer.json and run composer update., (*4)

"require": {
    "koshatul/config": "~1.0"
}

Example

Example configuration file (could be in project root (in the repository), above that or in the users home directory), (*5)

[testsection]
test="testdatavalue"

[anothersection]
test="differentvalue"

[uritest]
mysqlurl="mysql://username:password@hostname:1234/schema"

Usage

You can use this package to get configuration from a global or specific configuration store., (*6)

It will pull values from the specified file first, and fallback to environment variables., (*7)

Config::Get('project/apikey')

would look in the file first for, (*8)

[project]
apikey="value"

and fallback to the environment variable, (*9)

PROJECT_APIKEY="value"
use Koshatul\Config\Config;

$value = Config::Get('project/apikey');

print_r($value);

$array = array(
    'driver'   => 'pdo_mysql',
    'host'     => Config::GetMySQLURI('project/db', PHP_URL_HOST),
    'dbname'   => Config::GetMySQLURI('project/db', PHP_URL_PATH),
    'user'     => Config::GetMySQLURI('project/db', PHP_URL_USER),
    'password' => Config::GetMySQLURI('project/db', PHP_URL_PASS),
    'port'     => $port,
);

print_r($array);

The Versions

23/09 2016

dev-master

9999999-dev

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

23/09 2016

v1.2.1

1.2.1.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

23/09 2016

v1.2.0

1.2.0.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

24/03 2016

v1.1.2

1.1.2.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

The Development Requires

23/03 2016

v1.1.1

1.1.1.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

The Development Requires

23/03 2016

v1.1.0

1.1.0.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

The Development Requires

18/12 2015

v1.0.6

1.0.6.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

The Development Requires

02/10 2015

v1.0.5

1.0.5.0

Koshatul Config Class

  Sources   Download

MIT

The Requires

 

The Development Requires