1. Go to this page and download the library: Download sheikhheera/iconfig library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
new Iconfig\Config('../myApp/config', 'Config'); // Config as Alias, you can use any name
if(Config::isExist('session')) {
Config::setSession('driver', 'database');
$sessionArray = Config::getSession(); // full array will be returned when called without argument
}
$chache = getChache('path', '/web') // if path doesn't exist then "/web" will be returned
Config::getDatabase('connections.sqlite.driver'); // get the driver from sqlite
Config::getDatabase('connections.pgsql.driver'); // get the driver from pgsql
$connections = Config::getDatabase('connections', function($data){
if(is_array($data) && array_key_exists('sqlite', $data)) {
Config::setDatabase('connections.sqlite.driver', 'myNewSqliteDriver');
return Config::getDatabase('connections'); // this will return connections array with new value
}
});
Config::find('sqlite'); // if it exists, you'll get the value
Config::find('connections.sqlite'); // it'll look sqlite in to the connections
Config::find('connections.sqlite.driver'); // it'll look driver in to the connections.sqlite array
$all = Config::getAll();
var_dump($all); // full configuration array will be returned
Config::load('filePath'); // new items will be added.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.