|
|
@ -253,13 +253,17 @@ abstract class Module extends Component |
|
|
|
$config = $this->_moduleConfig[$id]; |
|
|
|
$config = $this->_moduleConfig[$id]; |
|
|
|
if (!isset($config['enabled']) || $config['enabled']) |
|
|
|
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']; |
|
|
|
$class = $config['class']; |
|
|
|
unset($config['class'], $config['enabled']); |
|
|
|
unset($config['class'], $config['enabled']); |
|
|
|
if ($this === Yii::app()) |
|
|
|
if ($this === \Yii::$app) |
|
|
|
|
|
|
|
{ |
|
|
|
$module = Yii::create($class, $id, null, $config); |
|
|
|
$module = Yii::create($class, $id, null, $config); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
$module = Yii::create($class, $this->getId() . '/' . $id, $this, $config); |
|
|
|
$module = Yii::create($class, $this->getId() . '/' . $id, $this, $config); |
|
|
|
|
|
|
|
} |
|
|
|
return $this->_modules[$id] = $module; |
|
|
|
return $this->_modules[$id] = $module; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -360,10 +364,9 @@ abstract class Module extends Component |
|
|
|
$config = $this->_componentConfig[$id]; |
|
|
|
$config = $this->_componentConfig[$id]; |
|
|
|
if (!isset($config['enabled']) || $config['enabled']) |
|
|
|
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']); |
|
|
|
unset($config['enabled']); |
|
|
|
$component = Yii::create($config); |
|
|
|
$component = \Yii::create($config); |
|
|
|
$component->init(); |
|
|
|
|
|
|
|
return $this->_components[$id] = $component; |
|
|
|
return $this->_components[$id] = $component; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|