1. Go to this page and download the library: Download m1/vars 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/ */
m1 / vars example snippets
$vars = new Vars(__DIR__.'/config/config.yml');
$vars->toEnv();
$app['vars']['test_key_1.test_key_2']; // value
$app['vars']['test_key_3']; // value
$app->register(new M1\Vars\Provider\Silex\VarsServiceProvider('example.yml'));
// register monolog here and other service providers
$app['vars.merge']();
php
// load single file
$vars = new Vars(__DIR__.'/config/config.yml');
// load from dir
$vars = new Vars(__DIR__.'/config');
// load from array
$vars = new Vars(array(
__DIR__.'/config/config.yml',
__DIR__.'/config/sub',
));
php
// All return the same thing
$vars->get('db.password')
$vars['db.password'];
$vars['db']['password']
php
// All do the same thing
$vars->toEnv();
getenv('db.password');