PHP code example of web6 / config

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

    

web6 / config example snippets



// The configuration is stored in a simple PHP array
$config = array();
$config['title'] = 'Lorem Ipsum sit dolor amet';
// IMPORTANT : return the configuration!
return $config;



var $config = new \W6\Config\Reader( '/path/to/config.php' );

print_r($config->environment);
print_r($config->debug);
print_r($config->debug['level']);


$conf = array();

/**
 * SECTION : ENVIRONMENT 
 * Defines the environment
 * Possible choices :
 * - development
 * - production
 */
$conf['environment'] = 'development';

/**
 * SECTION : DEBUG 
 * Debugging options
 */
$conf['debug'] = array();

    /**
     * Debug level
     * 0 - No messages
     * 1 - Show messages
     * 2 - Show messages + backtrace
     */
    $conf['debug']['level'] = $conf['environment'] == 'development' ? 2 : 0;

/**
 * SECTION : USER 
 * Include other configuration files
 */
$conf['user'] =