PHP code example of mkomorowski / php-config

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

    

mkomorowski / php-config example snippets


return array(
        'debug' => true,
        'database' => array(
            'host' => '127.0.0.1',
            'password' => 'password',
        ),
);

return array(
        'debug' => false,
        'database' => array(
            'host' => 'rds.amazon.com',
            'password' => 'password',
        ),
);

$loader = new mKomorowski\Config\Loader('/app/config');

$environment = new mKomorowski\Config\Environments(array(
    'local' => array('local', 'MacBook.local'),
    'stage' => array('cent_os_stage')
));

$config = new mKomorowski\Config\Config($loader, $environment, 'stage');

$config->setDefaultEnvironment('production');

$config->get('debug');

$config->get('database.hostname');
sh
php composer.phar update