yiiext/migrate-command — pull request #18 by magefad (2013-02-07 14:48:46+00:00)
Title: Changed Yii::app()->modules to Yii::app()->getModules() due Exception

While he does not fully understand why it happens.
With Yii::app()->modules calls
>\framework\CModule.php(103): CModule->getComponent('modules'),

instead !simple get private $_modules via getModules()!
then
>\framework\CModule.php(386): YiiBase::createComponent(Array)

Array - list of module names (ids)
and get Exception 'Object configuration must be an array containing a "class" element.

With this commit - Yii::app()->getModules() calls the appropriate method getModules() without errors..

>\framework\CModule.php(307): CModule->getModules(),

Trace
```text
'Object configuration must be an array containing a "class" element.
#0 \framework\CModule.php(386): YiiBase::createComponent(Array)
#1 \framework\CModule.php(103): CModule->getComponent('modules')
#2 S:\home\fadcms.ru\www\protected\extensions\migrate-command\EMigrateCommand.php(85): CModule->__get('modules')
#3 S:\home\fadcms.ru\www\protected\extensions\migrate-command\EMigrateCommand.php(147): EMigrateCommand->getModulePaths()
#4 \framework\CComponent.php(188): EMigrateCommand->getDisabledModules()
#5 S:\home\fadcms.ru\www\protected\extensions\migrate-command\EMigrateCommand.php(207): CComponent->__isset('disabledModules')
#6 S:\framework\console\CConsoleCommand.php(170): EMigrateCommand->beforeAction('up', Array)
#7 S:\framework\console\CConsoleCommandRunner.php(67): CConsoleCommand->run(Array)
#8 S:\home\fadcms.ru\www\protected\components\CommandExecutor.php(56): CConsoleCommandRunner->run(Array)
#9 S:\home\fadcms.ru\www\protected\modules\install\controllers\DefaultController.php(128): CommandExecutor->__call('migrate', Array)
#10 S:\home\fadcms.ru\www\protected\modules\install\controllers\DefaultController.php(128): CommandExecutor->migrate('up --module=use...')
#11 [internal function]: DefaultController->actionModuleInstall('user')
#12 S:\framework\web\actions\CAction.php(108): ReflectionMethod->invokeArgs(Object(DefaultController), Array)
#13 S:\framework\web\actions\CInlineAction.php(47): CAction->runWithParamsInternal(Object(DefaultController), Object(ReflectionMethod), Array)
#14 S:\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#15 S:\framework\web\filters\CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#16 S:\framework\web\CController.php(1130): CFilterChain->run()
#17 S:\framework\web\filters\CInlineFilter.php(58): CController->filterAjaxOnly(Object(CFilterChain))
#18 S:\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#19 S:\framework\web\CController.php(291): CFilterChain->run()
#20 S:\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#21 S:\framework\web\CWebApplication.php(282): CController->run('moduleInstall')
#22 S:\framework\web\CWebApplication.php(141): CWebApplication->runController('install/default...')
#23 \framework\CApplication.php(169): CWebApplication->processRequest()
#24 S:\home\fadcms.ru\www\index.php(18): CApplication->run()
#25 {main}
```