Index: trunk/core/kernel/application.php
===================================================================
diff -u -r2015 -r2112
--- trunk/core/kernel/application.php (.../application.php) (revision 2015)
+++ trunk/core/kernel/application.php (.../application.php) (revision 2112)
@@ -1123,6 +1123,18 @@
}
/**
+ * Returns true if config exists and is allowed for reading
+ *
+ * @param string $prefix
+ * @return bool
+ */
+ function prefixRegistred($prefix)
+ {
+ $unit_config_reader =& $this->recallObject('kUnitConfigReader');
+ return $unit_config_reader->prefixRegistred($prefix);
+ }
+
+ /**
* Splits any mixing of prefix and
* special into correct ones
*
@@ -1307,6 +1319,7 @@
return 0;
}
+
}
?>
\ No newline at end of file
Index: trunk/core/kernel/utility/unit_config_reader.php
===================================================================
diff -u -r2060 -r2112
--- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 2060)
+++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 2112)
@@ -56,6 +56,17 @@
}
/**
+ * Returns true if config exists and is allowed for reading
+ *
+ * @param string $prefix
+ * @return bool
+ */
+ function prefixRegistred($prefix)
+ {
+ return isset($this->configData[$prefix]) ? true : false;
+ }
+
+ /**
* Read configs from all directories
* on path specified
*
@@ -338,7 +349,7 @@
*/
function getUnitOption($prefix,$name)
{
- return isset($this->configData[$prefix][$name])?$this->configData[$prefix][$name]:false;
+ return isset($this->configData[$prefix][$name]) ? $this->configData[$prefix][$name] : false;
}
/**
@@ -350,7 +361,7 @@
*/
function getUnitOptions($prefix)
{
- return isset($this->configData[$prefix])?$this->configData[$prefix]:false;
+ return $this->prefixRegistred($prefix) ? $this->configData[$prefix] : false;
}
/**
@@ -363,7 +374,7 @@
*/
function setUnitOption($prefix,$name,$value)
{
- $this->configData[$prefix][$name]=$value;
+ $this->configData[$prefix][$name] = $value;
}
function getPrefixByParamName($paramName,$prefix)
Index: trunk/core/kernel/event_manager.php
===================================================================
diff -u -r2060 -r2112
--- trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 2060)
+++ trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 2112)
@@ -88,17 +88,26 @@
*/
function HandleEvent(&$event)
{
+ if( !$this->Application->prefixRegistred($event->Prefix) )
+ {
+ trigger_error('Prefix '.$event->Prefix.' not registred (requested event '.$event->Name.')', E_USER_NOTICE);
+ return false;
+ }
+
if (!$event->SkipBeforeHooks) {
$this->processHooks($event, hBEFORE);
- if ($event->status == erFATAL) return;
+ if ($event->status == erFATAL) return true;
}
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
$event_handler->processEvent($event);
- if ($event->status == erFATAL) return;
+
+ if ($event->status == erFATAL) return true;
if (!$event->SkipAfterHooks) {
$this->processHooks($event, hAFTER);
}
+
+ return true;
}
function ProcessRequest()