| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Config.php example with IniCommented container
|
|
|
4 |
* This container is for PHP .ini files, when you want
|
|
|
5 |
* to keep your comments. If you don't use comments, you'd rather
|
|
|
6 |
* use the IniFile.php container.
|
|
|
7 |
* @author Bertrand Mansion <bmansion@mamasam.com>
|
|
|
8 |
* @package Config
|
|
|
9 |
*/
|
|
|
10 |
// $Id: IniCommented.php 203590 2005-12-24 02:16:58Z aashley $
|
|
|
11 |
|
|
|
12 |
require_once('Config.php');
|
|
|
13 |
|
|
|
14 |
$datasrc = '/usr/local/php5/lib/php.ini';
|
|
|
15 |
|
|
|
16 |
$phpIni = new Config();
|
|
|
17 |
$root =& $phpIni->parseConfig($datasrc, 'inicommented');
|
|
|
18 |
if (PEAR::isError($root)) {
|
|
|
19 |
die($root->getMessage());
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
// Convert your ini file to a php array config
|
|
|
23 |
|
|
|
24 |
echo '<pre>'.$root->toString('phparray', array('name' => 'php_ini')).'</pre>';
|
|
|
25 |
?>
|