mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2024-11-29 18:47:35 +08:00
modified 优化安装脚本
This commit is contained in:
parent
b4db39c54d
commit
9680a01990
@ -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([
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 [
|
||||
|
Loading…
Reference in New Issue
Block a user