[icinga-checkins] icinga.org: icinga-web/mhein/default: * PHP 5. 3 NS fix and updated doctrineDBBuilder

git at icinga.org git at icinga.org
Fri May 28 17:14:40 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: 6c191240a121fdb2a073504c9f5937c8cfe577d1
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=6c191240a121fdb2a073504c9f5937c8cfe577d1

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Thu May 27 11:36:41 2010 +0200

* PHP 5.3 NS fix and updated doctrineDBBuilder

---

 modules/bin/doctrineDBBuilderTask.php |    5 +++--
 modules/bin/xmlMergerTask.php         |    9 ++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/bin/doctrineDBBuilderTask.php b/modules/bin/doctrineDBBuilderTask.php
index 257d37f..799edad 100755
--- a/modules/bin/doctrineDBBuilderTask.php
+++ b/modules/bin/doctrineDBBuilderTask.php
@@ -80,8 +80,9 @@ class doctrineDBBuilderTask extends Task {
 		}
 
 		$appKitPath = $this->project->getUserProperty("PATH_AppKit");
-		Doctrine::loadModels($icinga.$appKitPath."database/models/generated");
-		Doctrine::loadModels($icinga.$appKitPath."database/models");
+
+		Doctrine::loadModels($icinga."/".$appKitPath."database/models/generated");
+		Doctrine::loadModels($icinga."/".$appKitPath."database/models");
 		Doctrine::createTablesFromModels(array($this->models.'/generated',$this->models));
 	
 		file_put_contents($modelPath."/.models.cfg",implode(",",$tableList));
diff --git a/modules/bin/xmlMergerTask.php b/modules/bin/xmlMergerTask.php
index 8d2c841..f023835 100755
--- a/modules/bin/xmlMergerTask.php
+++ b/modules/bin/xmlMergerTask.php
@@ -7,6 +7,13 @@
  */
 require_once("actionQueueTask.php");
 require_once("xmlHelperTask.php");
+
+$vers = phpversion();
+if($vers[1] < 3) 
+	define("USE_XML_NSPREFIX_WORKAROUND",true);
+else 
+	define("USE_XML_NSPREFIX_WORKAROUND",false);
+	
 class xmlMergerTask extends xmlHelperTask {
 	/**
 	 * The xml target file to merge to
@@ -233,7 +240,7 @@ class xmlMergerTask extends xmlHelperTask {
 				$prefix = (count($prefix) == 2 ? $prefix[0] : null);
 				$im_node = $this->getTargetDOM()->importNode($newNode,true);
 				// PHP removes the namespace prefix of our node, reappend it
-				if($prefix != null) 
+				if($prefix != null && USE_XML_NSPREFIX_WORKAROUND) 
 					$im_node = $this->fixPrefix($im_node,$prefix,$newNode);
 				$target[$pathToAdd][0]["elem"]->appendChild($im_node);
 				





More information about the icinga-checkins mailing list