[CS-Project-svn_notify] SF.net SVN: cs-project: [818] trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA3.php
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-09 05:34:17
|
Revision: 818 http://cs-project.svn.sourceforge.net/cs-project/?rev=818&view=rev Author: crazedsanity Date: 2008-02-08 21:34:13 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Beginning of re-writing XML config, but HTML encoding is a bitch (issue #150) Modified Paths: -------------- trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA3.php Modified: trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA3.php =================================================================== --- trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA3.php 2008-02-09 05:33:30 UTC (rev 817) +++ trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA3.php 2008-02-09 05:34:13 UTC (rev 818) @@ -1,6 +1,6 @@ <?php /* - * Created on Nov 20, 2007 + * Created on February 08, 2008 */ @@ -18,7 +18,7 @@ $this->logsObj = new logsClass($this->db, 'Upgrade'); $this->gfObj = new cs_globalFunctions; - $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; + $this->gfObj->debugPrintOpt = 1; }//end __construct() //========================================================================= @@ -27,16 +27,48 @@ //========================================================================= public function run_upgrade() { - $this->db->beginTrans(__METHOD__); - + $this->update_config_file(); exit; $this->db->commitTrans(__METHOD__); }//end run_upgrade() //========================================================================= + + + + //========================================================================= + public function update_config_file() { + $fs = new cs_fileSystemClass(dirname(__FILE__) .'/../'); + $sampleXmlObj = new XMLParser($fs->read('docs/samples/sample_config.xml')); + $siteXmlObj = new XMLParser($fs->read('lib/config.xml')); + + $updateXml = new xmlCreator(); + $updateXml->load_xmlparser_data($siteXmlObj); + + $sampleIndexes = $sampleXmlObj->get_tree(TRUE); + $sampleIndexes = $sampleIndexes['CONFIG']; + $siteConfigIndexes = $siteXmlObj->get_tree(TRUE); + + foreach($sampleIndexes as $indexName=>$indexValue) { + $path = '/CONFIG/'. $indexName; + $attributes = $sampleXmlObj->get_attribute($path); + #debug_print(__METHOD__ .": attributes from sample (/CONFIG/". $indexName ."::: ",1); + #debug_print($attributes,1); + + if(is_array($attributes)) { + $updateXml->add_attribute($path, $attributes); + } + } + + $this->gfObj->debug_print($updateXml->create_xml_string()); + $fs->openFile('lib/_test_config.xml'); + $fs->write($updateXml->create_xml_string()); + exit; + }//end update_config_file() + //========================================================================= } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |