PHP code example of vakata / config
1. Go to this page and download the library: Download vakata/config 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/ */
vakata / config example snippets
php
$config = new \vakata\config\Config([ 'key' => 'value' ]);
$config->fromFile(__DIR__ . '/config.env');
$config->get('key'); // "value"
$config->set('key', 2); // 2
$config->get('key'); // 2
$config->del('key'); // true
$config->get('key'); // null
$config->get('key', 'default'); // "default"
$config->export(); // export all stored values to enviroment and $_SERVER
$config->export(true); // same as above but overwrite existing values
bash
$ phpunit --bootstrap ./vendor/autoload.php ./tests/