dnsmgr/app/command/Opiptask.php

34 lines
749 B
PHP
Raw Normal View History

2024-05-01 10:51:34 +08:00
<?php
declare(strict_types=1);
2024-05-01 10:51:34 +08:00
namespace app\command;
use Exception;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Db;
2024-07-07 15:54:11 +08:00
use think\facade\Config;
2024-05-01 10:51:34 +08:00
use app\lib\OptimizeService;
class Opiptask extends Command
{
protected function configure()
{
// 指令配置
$this->setName('opiptask')
->setDescription('CF优选IP任务');
}
protected function execute(Input $input, Output $output)
{
$res = Db::name('config')->cache('configs', 0)->column('value', 'key');
2024-07-07 15:54:11 +08:00
Config::set($res, 'sys');
2024-05-01 10:51:34 +08:00
(new OptimizeService())->execute();
}
}