完成内置的数据库日志驱动;内置数据库日志的定时清除;更新新的数据库sql;

This commit is contained in:
2022-04-03 15:29:06 +08:00
parent dc1b3d4ab4
commit 2a97375418
12 changed files with 487 additions and 390 deletions

View File

@@ -5,6 +5,8 @@ declare(strict_types=1);
namespace app\common\command;
use app\common\tools\PathTools;
use PDO;
use think\Config as ThinkConfig;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
@@ -34,6 +36,8 @@ class Install extends Command
protected function execute(Input $input, Output $output)
{
// 指令输出
$force = $input->getOption('force');
@@ -76,6 +80,12 @@ class Install extends Command
Db::startTrans();
try {
foreach ($sqlArray as $vo) {
if (strpos($vo, 'LOCK TABLES') === 0) {
continue;
}
if (strpos($vo, 'UNLOCK') === 0) {
continue;
}
Db::execute($vo);
}
Db::name('system_admin')

View File

@@ -2,9 +2,15 @@
return [
[
'name'=>'http_demo', // 定时任务的名称,不能重
'type'=>'site', // 定时任务的类型默认只支持site你也可以重写定时器命令行以支持其他命令
'target'=>'/tools/timer.ResetPassword/do', // 要访问的地址如果不是以https开头那么以后台的系统配置中读取相关配置如果没有配置则不执行
'frequency'=>600 // 执行频率单位填写10则每10秒过后执行一次
]
];
'name' => 'http_demo', // 定时任务的名称,不能重
'type' => 'site', // 定时任务的类型默认只支持site你也可以重写定时器命令行以支持其他命令
'target' => '/tools/timer.ResetPassword/do', // 要访问的地址如果不是以https开头那么以后台的系统配置中读取相关配置如果没有配置则不执行
'frequency' => 600 // 执行频率单位填写10则每10秒过后执行一次
],
[
'name' => 'clear_log', // 定时任务的名称,不能重复
'type' => 'site', // 定时任务的类型默认只支持site你也可以重写定时器命令行以支持其他命令
'target' => '/tools/timer.ClearLog/do', // 要访问的地址如果不是以https开头那么以后台的系统配置中读取相关配置如果没有配置则不执行
'frequency' => 600 // 执行频率单位填写10则每10秒过后执行一次
],
];