我正在尝试在 user-management 中安装Yii2模块。 我在运行此模块的迁移命令时遇到错误。
以下是我终端的新堆栈跟踪:
$ sudo php yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations
Yii Migration Tool (based on Yii v2.0.3)
Total 10 new migrations to be applied:
m140608_173539_create_user_table
m140611_133903_init_rbac
m140808_073114_create_auth_item_group_table
m140809_072112_insert_superadmin_to_user
m140809_073114_insert_common_permisison_to_auth_item
m141023_141535_create_user_visit_log
m141116_115804_add_bind_to_ip_and_registration_ip_to_user
m141121_194858_split_browser_and_os_column
m141201_220516_add_email_and_email_confirmed_to_user
m141207_001649_create_basic_user_permissions
Apply the above migrations? (yes|no) [no]:yes
*** applying m140608_173539_create_user_table
Exception: Trying to get property of non-object (/var/www/html/***/vendor/webvimark/module-user-management/migrations/m140608_173539_create_user_table.php:16)
#0 /var/www/html/***/vendor/webvimark/module-user-management/migrations/m140608_173539_create_user_table.php(16): yii\base\ErrorHandler->handleError(8, 'Trying to get p...', '/var/www/html/m...', 16, Array)
#1 /var/www/html/***/vendor/yiisoft/yii2/db/Migration.php(81): m140608_173539_create_user_table->safeUp()
#2 /var/www/html/***/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(492): yii\db\Migration->up()
#3 /var/www/html/***/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(129): yii\console\controllers\BaseMigrateController->migrateUp('m140608_173539_...')
#4 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#5 /var/www/html/***/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#6 /var/www/html/***/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams(Array)
#7 /var/www/html/***/vendor/yiisoft/yii2/console/Controller.php(91): yii\base\Controller->runAction('', Array)
#8 /var/www/html/***/vendor/yiisoft/yii2/base/Module.php(455): yii\console\Controller->runAction('', Array)
#9 /var/www/html/***/vendor/yiisoft/yii2/console/Application.php(161): yii\base\Module->runAction('migrate', Array)
#10 /var/www/html/***/vendor/yiisoft/yii2/console/Application.php(137): yii\console\Application->runAction('migrate', Array)
#11 /var/www/html/***/vendor/yiisoft/yii2/base/Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#12 /var/www/html/***/yii(23): yii\base\Application->run()
#13 {main}
*** failed to apply m140608_173539_create_user_table (time: 0.004s)
Migration failed. The rest of the migrations are canceled.
我不确定,我在这里做错了什么。
答案 0 :(得分:2)
确保在应用程序配置中包含模块:
$this->createTable(Yii::$app->getModule('user-management')->user_table, array(
它包含在扩展自述文件中。
在此行中访问不存在的模块时,它正在下降:
$string = "Héllo";
echo replace_fc($string);