Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Jul 24, 2016
1 parent 3de8892 commit 65abc04
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 11 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"raulfraile/distill": "@stable",
"yiisoft/yii2-imagine": "^2.0",
"fabpot/goutte": "^3.1",
"kartik-v/yii2-widget-select2": "*"
"kartik-v/yii2-widget-select2": "*",
"udokmeci/yii2-beanstalk": "dev-master"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
Expand Down
111 changes: 108 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions console/controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public function setKeys($file)
public function actionSetDb()
{
do {
$dbHost = $this->prompt('dbhost:', ['default' => '127.0.0.1']);
$dbPort = $this->prompt('dbport:', ['default' => '3306']);
$dbDbname = $this->prompt('dbname(auto create):', ['default' => 'yii']);
$dbUsername = $this->prompt('dbusername:', ['default' => 'root']);
$dbPassword = $this->prompt('dbpassword:');
$dbHost = $this->prompt('dbhost(默认为中括号内的值)' . PHP_EOL, ['default' => '127.0.0.1']);
$dbPort = $this->prompt('dbport(默认为中括号内的值)' . PHP_EOL, ['default' => '3306']);
$dbDbname = $this->prompt('dbname(不存在则自动创建)' . PHP_EOL, ['default' => 'yii']);
$dbUsername = $this->prompt('dbusername(默认为中括号内的值)' . PHP_EOL, ['default' => 'root']);
$dbPassword = $this->prompt('dbpassword' . PHP_EOL);
$dbDsn = "mysql:host={$dbHost};port={$dbPort}";
} while(!$this->testConnect($dbDsn, $dbDbname, $dbUsername, $dbPassword));
$dbDsn = "mysql:host={$dbHost};port={$dbPort};dbname={$dbDbname}";
$dbTablePrefix = $this->prompt('tableprefix:', ['default' => 'yii2cmf_']);
$dbTablePrefix = $this->prompt('tableprefix(默认为中括号内的值)' . PHP_EOL, ['default' => 'yii2cmf_']);
$this->setEnv('DB_USERNAME', $dbUsername);
$this->setEnv('DB_PASSWORD', $dbPassword);
$this->setEnv('DB_TABLE_PREFIX', $dbTablePrefix);
Expand Down Expand Up @@ -126,6 +126,17 @@ public function actionInstall()
$this->stdout("\n ... 已经安装过.\n\n", Console::FG_RED);
die;
}
$str = <<<STR
+==========================================+
| Welcome to setup yii2cmf |
| 欢迎使用 yii2cmf 安装程序 |
+------------------------------------------+
| Follow the on-screen instructions please |
| 请按照屏幕上的提示操作以完成安装 |
+==========================================+
STR;
$this->stdout($str, Console::FG_GREEN);
copy(Yii::getAlias('@root/.env.example'), Yii::getAlias($this->envPath));
$this->runAction('set-writable', ['interactive' => $this->interactive]);
$this->runAction('set-executable', ['interactive' => $this->interactive]);
Expand Down
2 changes: 1 addition & 1 deletion database/migrations/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ UNLOCK TABLES;

LOCK TABLES {{%menu}} WRITE;
/*!40000 ALTER TABLE {{%menu}} DISABLE KEYS */;
INSERT INTO `pop_menu` (`id`, `name`, `parent`, `route`, `order`, `data`, `icon`)
INSERT INTO {{%menu}} (`id`, `name`, `parent`, `route`, `order`, `data`, `icon`)
VALUES
(24, '系统管理', NULL, NULL, 2, NULL, 'cog'),
(30, '数据库备份', NULL, NULL, 5, NULL, 'book'),
Expand Down

0 comments on commit 65abc04

Please sign in to comment.