From 2b3492ab29900d7071791c9c402bd9434e7cf56d Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 9 Dec 2011 06:24:24 +0400 Subject: [PATCH] Yii references fix --- framework/base/Module.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/framework/base/Module.php b/framework/base/Module.php index 521db25..82a4b0c 100644 --- a/framework/base/Module.php +++ b/framework/base/Module.php @@ -253,13 +253,17 @@ abstract class Module extends Component $config = $this->_moduleConfig[$id]; if (!isset($config['enabled']) || $config['enabled']) { - Yii::trace("Loading \"$id\" module", 'system.base.CModule'); + \Yii::trace("Loading \"$id\" module", 'system.base.CModule'); $class = $config['class']; unset($config['class'], $config['enabled']); - if ($this === Yii::app()) + if ($this === \Yii::$app) + { $module = Yii::create($class, $id, null, $config); + } else + { $module = Yii::create($class, $this->getId() . '/' . $id, $this, $config); + } return $this->_modules[$id] = $module; } } @@ -360,10 +364,9 @@ abstract class Module extends Component $config = $this->_componentConfig[$id]; if (!isset($config['enabled']) || $config['enabled']) { - Yii::trace("Loading \"$id\" application component", 'system.CModule'); + \Yii::trace("Loading \"$id\" application component", 'system.CModule'); unset($config['enabled']); - $component = Yii::create($config); - $component->init(); + $component = \Yii::create($config); return $this->_components[$id] = $component; } }