Source for file OCSP_XMLARRAY.phpclass

Documentation is available at OCSP_XMLARRAY.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file OCSP_XMLARRAY.phpclass
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package default
  7.   *
  8.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  9.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.   *
  11.   * @since pk-17.03.2008
  12.   * @version $Id: OCSP_XMLARRAY.phpclass,v 1.1 2008/03/23 11:33:54 pitlinz Exp $
  13.   ***/
  14.  
  15. // ---------------------------------------------------------
  16. // requirements
  17. // ---------------------------------------------------------
  18.  
  19. if (!class_exists('OCSP_OBJ'))
  20. {
  21.     require_once __OCSP_PHPINCPATH__ "common" _OCSP_DIRSEP_ "OCSP_OBJ.phpclass";
  22. }
  23.  
  24. /**
  25.   * openCSP class OCSP_XMLARRAY
  26.   *
  27.   * @project Open CSP-Management
  28.   * @package default
  29.   *
  30.   *  taken form: Class for store arrays in XML files.
  31.   * @author Augusto Cesar Castoldi <castoldi@inf.ufsc.br>
  32.   * @date 2003-11-21
  33.   * @see http://www.phpclasses.org/browse/file/5240.html
  34.   *
  35.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  36.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  37.   *
  38.   * @since pk-17.03.2008
  39.   * @version $Id: OCSP_XMLARRAY.phpclass,v 1.1 2008/03/23 11:33:54 pitlinz Exp $
  40.   ***/
  41. {
  42.     /*** class constants  --------------------------------------------- */
  43.  
  44.     /**
  45.      * @constant string CLASS_SRC_FILE
  46.      *
  47.      * @abstract
  48.      */
  49.     const CLASS_SRC_FILE = __FILE__;
  50.  
  51.     /*** class variables  --------------------------------------------- */
  52.     
  53.     /*** compostion --------------------------------------------------- */
  54.     
  55.     /*** attributes  -------------------------------------------------- */
  56.  
  57.     /*** static functions---------------------------------------------- */
  58.         
  59.       /**
  60.      * Save the $array into the XML $xmlPath
  61.      * @param array $array array of strings
  62.      * @param string $xmlPath complete path of the xml file. Ex.: /home/user/test/XmlArrayTest.xml
  63.      */
  64.       public static function saveXML($array$xmlPath)
  65.        {
  66.            $obj_xml new DOMDocument("1.0");           
  67.         $elements $obj_xml->createElement("array");
  68.         $elementsNode $obj_xml->appendChild($elements);
  69.         for ($i 0$i count($array)$i++)
  70.         {
  71.               $element $obj_xml->createElement("element");
  72.               $element->set_content($array[$i]);
  73.               $elementsNode->appendChild($element);
  74.         }
  75.         $obj_xml->save($xmlPath);
  76.       }
  77.  
  78.       /**
  79.      * Reads the $xmlPath file and returns an array.
  80.      * @param string $xmlPath complete path of the xml file. Ex.: /home/user/test/XmlArrayTest.xml
  81.      * @return array 
  82.      */
  83.       public static function getArray($xmlPath)
  84.       {
  85.         $i 0;
  86.         $obj_xml new DOMDocument("1.0");
  87.         $obj_xml->load($xmlPath);
  88.  
  89.       }
  90.       
  91.       
  92.       
  93.  
  94. }     
  95.  
  96. ?>

Documentation generated on Thu, 08 Jan 2009 17:47:34 +0100 by phpDocumentor 1.4.0a2