home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / IniCommented.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  678 b   |  25 lines

  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,v 1.3 2003/03/21 18:01:09 mansion Exp $
  11.  
  12. require_once('Config.php');
  13.  
  14. $datasrc = '/path/to/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. ?>