[icinga-checkins] icinga.org: icinga-web/jmosshammer/default2: * Doctrine dependency fix, snippet RegExp fix

git at icinga.org git at icinga.org
Tue May 11 10:03:25 CEST 2010


Module: icinga-web
Branch: jmosshammer/default2
Commit: 2af5ffdd79be66549e3b7612dff0ffdfe7de0398
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=2af5ffdd79be66549e3b7612dff0ffdfe7de0398

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Mon May 10 12:33:56 2010 +0200

* Doctrine dependency fix, snippet RegExp fix

---

 modules/bin/doctrineDBBuilderTask.php |   10 ++++++++--
 modules/bin/snippetExtractorTask.php  |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/bin/doctrineDBBuilderTask.php b/modules/bin/doctrineDBBuilderTask.php
index d2a1c55..c79e95c 100755
--- a/modules/bin/doctrineDBBuilderTask.php
+++ b/modules/bin/doctrineDBBuilderTask.php
@@ -71,14 +71,20 @@ class doctrineDBBuilderTask extends Task {
 	public function buildDBFromModels() {	
 		$icinga = $this->project->getUserProperty("PATH_Icinga");
 		$modelPath = $icinga."/app/modules/".$this->project->getUserProperty("MODULE_Name")."/lib/";
-		Doctrine::createTablesFromModels(array($this->models.'/generated',$this->models));
+		self::$AppKitPath = $icinga."/lib/appkit/";
+		require_once(self::$AppKitPath."/auth/AppKitUserPreferences.interface.php");
+		
 		Doctrine::loadModels($this->models);
 		$tables = Doctrine::getLoadedModels();
 		$tableList = array();
 		foreach($tables as $table) {
 			$tableList[] = Doctrine::getTable($table)->getTableName();	
 		}
-
+	
+		Doctrine::loadModels($icinga."/lib/appkit/database/models/generated");
+		Doctrine::loadModels($icinga."/lib/appkit/database/models");
+		Doctrine::createTablesFromModels(array($this->models.'/generated',$this->models));
+	
 		file_put_contents($modelPath."/.models.cfg",implode(",",$tableList));
 	}
 	
diff --git a/modules/bin/snippetExtractorTask.php b/modules/bin/snippetExtractorTask.php
index 153fd0f..3ccaed6 100755
--- a/modules/bin/snippetExtractorTask.php
+++ b/modules/bin/snippetExtractorTask.php
@@ -74,7 +74,7 @@ class snippetExtractorTask extends Task {
 				throw new BuildException("Extractor error: Marked file ".$file." doesn't exist!");
 			$content = file_get_contents($file);
 			$matches = array();
-			preg_match("/.*MODULE\[".$name."\].*[\r\n]+([\w\W\r\n]+)[\r\n]+.*?MODULE\[".$name."\].*?[\r\n]+/",$content,$matches);
+			preg_match("/.*MODULE\[".$name."\].*[\r\n]+([\w\W\r\n]+)[\r\n]+.*?MODULE\[".$name."\].*?[\r\n]*?/",$content,$matches);
 			if(count($matches) < 2) 	
 				echo "\Warning: Couldn't find a match for mark ".$name." in file ".$file;
 				





More information about the icinga-checkins mailing list