Source for file Ini.class.php

Documentation is available at Ini.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD Libary.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Config
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Config INI Writer
  22.  *
  23.  * @category Gumbo
  24.  * @package Config
  25.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  26.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  27.  * @author Michael Luster <mluster79@yahoo.com>
  28.  * @link http://sourceforge.net/projects/phpgumbo
  29.  * @desc Config INI Writer
  30.  * @version 0.0.1
  31.  */
  32.  
  33. gumbo_load ("Interface_Config_Writer");
  34. gumbo_load ("Branch");
  35. gumbo_load ("Leaf");
  36.  
  37. class Gumbo_Config_Writer_Ini implements Gumbo_Interface_Config_Writer {
  38.     
  39.     /** ACTION METHODS **/
  40.     /**
  41.      * Writes the supplied values into the configuration file
  42.      * @param Gumbo_Interface_Composite $tree 
  43.      * @param string $file file name to write to
  44.      * @param bool $replace replaces current file
  45.      * @return bool 
  46.      * @throws Gumbo_Exception
  47.      */
  48.     public function write (Gumbo_Interface_Composite $tree$file$replace=true{
  49.         try {
  50.             throw new Gumbo_Exception ("Implementation Not Written"ERROR_EMERGENCY);
  51.             // verify precondition
  52.                 // check for valid variable type
  53.                 if (!is_bool ($replace)) $replace true}
  54.                 // check for valid type
  55.             
  56.             // write the contents to the file
  57.         catch (Exception $e{
  58.             $e->setFunction (__METHOD__);
  59.             gumbo_trigger ($e);
  60.         }
  61.         return false;
  62.     }
  63.     
  64. }
  65.  
  66. ?>