catchAdmin/extend/catcher/command/Tools/BackupCommand.php

38 lines
861 B
PHP
Raw Normal View History

2019-12-13 17:25:05 +08:00
<?php
2019-12-13 17:26:54 +08:00
declare (strict_types = 1);
2020-04-29 15:06:13 +08:00
namespace catcher\command\Tools;
2019-12-13 17:26:54 +08:00
use catcher\CatchAdmin;
2020-07-19 16:47:58 +08:00
use catcher\facade\FileSystem;
use catcher\library\BackUpDatabase;
use catcher\library\Zip;
2019-12-13 17:26:54 +08:00
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;
class BackupCommand extends Command
{
protected $table;
protected function configure()
{
// 指令配置
$this->setName('backup:data')
->addArgument('tables', Argument::REQUIRED, 'backup tables')
->setDescription('backup data you need');
}
protected function execute(Input $input, Output $output)
{
$tables = $this->input->getArgument('tables');
2020-07-19 16:47:58 +08:00
(new BackUpDatabase)->done($tables);
2019-12-13 17:26:54 +08:00
$output->info('succeed!');
}
}