modified 优化安装脚本

This commit is contained in:
zhaoxiang 2020-10-10 15:32:30 +08:00
parent b4db39c54d
commit 9680a01990
3 changed files with 16 additions and 13 deletions

View File

@ -7,14 +7,11 @@ use app\util\Strs;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\db\Connection;
class Install extends Command {
protected function configure(): void {
// 指令配置
$this->setName('apiadmin:install')
->setDescription('ApiAdmin安装脚本');
$this->setName('apiadmin:install')->setDescription('ApiAdmin安装脚本');
}
/**
@ -53,8 +50,8 @@ class Install extends Command {
try {
$options = $this->parseDsnConfig($output);
Connection::instance($options)->getTables($options['database']);
$dsn = "{$options['type']}:dbname={$options['database']};host={$options['hostname']};port={$options['hostport']};charset={$options['charset']}";
new \PDO($dsn, $options['username'], $options['password']);
//处理数据库配置文件
$dbConf = str_replace([

View File

@ -1,7 +1,13 @@
<?php
/**
* Api路由
*/
// +----------------------------------------------------------------------
// | ApiAdmin [ JUST FOR API ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 https://www.apiadmin.org/ All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://gitee.com/apiadmin/ApiAdmin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: zhaoxiang <zhaoxiang051405@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

View File

@ -1,12 +1,12 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// | ApiAdmin [ JUST FOR API ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2017~2020 https://www.apiadmin.org/ All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// | Licensed ( https://gitee.com/apiadmin/ApiAdmin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// | Author: zhaoxiang <zhaoxiang051405@gmail.com>
// +----------------------------------------------------------------------
return [