Login   Register  
PHP Classes
elePHPant
Icontem

File: example_array.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mark Rolich  >  Config Loader  >  example_array.php  >  Download  
File: example_array.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Config Loader
Process configuration values parsed from ini files
Author: By
Last change:
Date: 1 year ago
Size: 508 bytes
 

Contents

Class file image Download
<?php
include 'Config.php';
$config parse_ini_file('config.ini'true);
$config = new Config($configConfig::PARSE_ARRAY);

try {
    
var_dump($config->options) . '<br>';

    echo 
$config->env '<br>';

    
var_dump($config->db);

    echo 
$config->db['host'] . '<br>';

    
var_dump($config->db['mysql']);

    
var_dump($config->log['path']);

    echo 
$config->db['mysql']['host'] . '<br>';

    echo 
$config->some['not']['existing']['option'];
} catch (
Exception $e) {
    echo 
$e->getMessage();
}
?>