summaryrefslogtreecommitdiff
path: root/framework/TApplication.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/TApplication.php')
-rw-r--r--framework/TApplication.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/framework/TApplication.php b/framework/TApplication.php
index d8214f09..d0c9a6d9 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -478,7 +478,10 @@ class TApplication extends TComponent
*/
public function setModule($id,IModule $module)
{
- $this->_modules[$id]=$module;
+ if(isset($this->_modules[$id]))
+ throw new TConfigurationException('application_moduleid_duplicated',$id);
+ else
+ $this->_modules[$id]=$module;
}
/**
@@ -762,7 +765,7 @@ class TApplication extends TComponent
Prado::trace("Loading module $id ({$moduleConfig[0]})",'System.TApplication');
$module=Prado::createComponent($moduleConfig[0]);
- $this->_modules[$id]=$module;
+ $this->setModule($id,$module);
foreach($moduleConfig[1] as $name=>$value)
$module->setSubProperty($name,$value);
$module->init($moduleConfig[2]);