2017 © Pedro Peláez
 

library config

Easy Configuration Management Library

image

azi/config

Easy Configuration Management Library

  • Monday, January 4, 2016
  • by azibaloch
  • Repository
  • 1 Watchers
  • 5 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Config

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)


Easy Configuration Management Library, (*2)

If you are writing a WordPress theme or a PHP application, most likely you will have some configuration values. The conventional approach involves creating a file with a bunch of variables and constants, then including every file in your script, which may not be the most intuitive way. Inspired by Laravel's elegant configuration handling, I developed Config to provide a similar experience for PHP projects, especially in the context of WordPress themes., (*3)


Installation

to install config in your project you just need to run this command, (*4)

$ composer require azi/config

Up & Running

after installing config you will need to create a directory named config in root of your project where your composer.json lives in this directory you can store your configuration files. i.e database.php or site.php lets say you want to store your database configuration values here. you will have to follow the following steps. - create a file called database.php - return your configuration values form that file like, (*5)

php return [ 'mysql' => [ 'host' => '127.0.0.1', 'username' => 'root', 'password' => 'secrete' ] ]; - access the values from anywhere in your application like ```php // will return 127.0.0.1 $host = Azi\Config::get('database.mysql.host');, (*6)

// OR $db = Azi\Config::get('database.mysql'); $host = $db->get('host'); $username = $db->get('username'); $password = $db->get('password');, (*7)

```, (*8)

with this package you will also get a little helper function to access values you can also write the above code like this, (*9)

php // will return 127.0.0.1 $host = config('database.mysql.host');, (*10)

# Contributers * @azeemhassni * @Golpha, (*11)

The Versions

04/01 2016

dev-master

9999999-dev

Easy Configuration Management Library

  Sources   Download

MIT

The Development Requires

by Azi Baloch

30/11 2015

0.2

0.2.0.0

Easy Configuration Management Library

  Sources   Download

MIT

The Development Requires

by Azi Baloch

27/11 2015

dev-development

dev-development

Easy Configuration Management Library

  Sources   Download

MIT

The Development Requires

by Azi Baloch

27/11 2015

0.1

0.1.0.0

Easy Configuration Management Library

  Sources   Download

MIT

The Development Requires

by Azi Baloch