Skip to content

Golpha/Config

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Config

Build Status Latest Stable Version Total Downloads Latest Unstable Version License


Easy Configuration Management Library

if your are writing a WordPress theme or a php application obviously you will have some configuration values. you will create a file with bunch of variable and constants and include every file in your script which is not an intuitive way as I feel. I like the way laravel handles configuration values. but we can't use laravel in our WordPress themes that's why I wrote Config


Installation

to install config in your project you just need to run this command

$ 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
  return [
     'mysql' => [
       'host' => '127.0.0.1',
       'username' => 'root',
       'password' => 'secrete'
     ]
   ];
  • access the values from anywhere in your application like
   // will return 127.0.0.1
$host = Azi\Config::get('database.mysql.host');

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

  // will return 127.0.0.1
  $host = config('database.mysql.host');

About

Easy Configuration Management Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%