PHP code example of alius / config

1. Go to this page and download the library: Download alius/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/ */

    

alius / config example snippets




return [
    'test' => 'this is a test',
];

$config = new \Alius\Config\Config('path_to_file.php');
print $config->get('test'); // => this is a test

$config = new \Alius\Config\Config([
    'path_to_file1.php',
    'path_to_file2.php',
]);


// file1.php
return [
    'test' => 'one',
];


// file2.php
return [
    'test' => 'two',
];

$config = new \Alius\Config\Config(['file1.php', 'file2.php']);
print $config->get('test'); // => two

print $config->getOrigin('test'); // => file2.php

$config = new \Alius\Config\Config('path_to_file.php', ['test']);
var_dump($config->isRequired('test')); // => true
var_dump($config->isRequired('test2')); // => false

config/non-sensitive-data1.php
config/non-sensitive-data2.php
exclude_this_dir_from_vc/database.php