[icinga-checkins] icinga.org: icinga-web/mhein/testing: * Finished merge of new module based configuration (II)

git at icinga.org git at icinga.org
Wed Aug 3 09:40:20 CEST 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Aug  2 13:26:15 2011 +0200

* Finished merge of new module based configuration (II)

---

 .../config/AppKitXIncludeConfigHandler.class.php   |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/app/modules/AppKit/lib/config/AppKitXIncludeConfigHandler.class.php b/app/modules/AppKit/lib/config/AppKitXIncludeConfigHandler.class.php
index f3224da..4d6a6ce 100644
--- a/app/modules/AppKit/lib/config/AppKitXIncludeConfigHandler.class.php
+++ b/app/modules/AppKit/lib/config/AppKitXIncludeConfigHandler.class.php
@@ -29,13 +29,18 @@ class AppKitXIncludeConfigHandler extends AgaviXmlConfigHandler {
         $configHandler = $refClass->newInstance();
         
         $configHandler->initialize($this->context, $this->parameters);
-
-        $nsprefix = array();
-        preg_match('/\/([a-z]+)\/[^\/]+$/', $configHandler::XML_NAMESPACE, $nsprefix);
-        $nsprefix = $nsprefix[1];
-
+        
+        $nsprefix = null;
+        
         if ($refClass->hasConstant('XML_NAMESPACE')) {
+            
+            $m = array();
+            preg_match('/\/([a-z]+)\/[^\/]+$/', $refClass->getConstant('XML_NAMESPACE'), $m);
+            $nsprefix = $m[1];
+            
             $document->setDefaultNamespace($refClass->getConstant('XML_NAMESPACE'), $nsprefix);
+        } else {
+            throw new AgaviConfigurationException('Could not read XML_NAMESPACE from class: '. $refClass->getName());
         }
 
         // Order of includes is essential because of dependencies





More information about the icinga-checkins mailing list