75 lines
1.3 KiB
PHP
75 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Commands;
|
|
|
|
use App\Controllers\AdvertisementManager\Automation\AutomationController;
|
|
use App\Services\LoggerService;
|
|
use CodeIgniter\CLI\BaseCommand;
|
|
use CodeIgniter\CLI\CLI;
|
|
use DateTime;
|
|
|
|
class Automation extends BaseCommand
|
|
{
|
|
/**
|
|
* The Command's Group
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $group = 'CodeIgniter';
|
|
|
|
/**
|
|
* The Command's Name
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $name = 'Automation';
|
|
|
|
/**
|
|
* The Command's Description
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '';
|
|
|
|
/**
|
|
* The Command's Usage
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $usage = 'command:Automation [arguments] [options]';
|
|
|
|
/**
|
|
* The Command's Arguments
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $arguments = [];
|
|
|
|
/**
|
|
* The Command's Options
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $options = [];
|
|
|
|
/**
|
|
* Actually execute a command.
|
|
*
|
|
* @param array $params
|
|
*/
|
|
public function run(array $params)
|
|
{
|
|
$automation = new AutomationController;
|
|
$automation->automation();
|
|
|
|
//로그 기록
|
|
$data = [
|
|
'type' => 'tasks',
|
|
'command' => $this->name
|
|
];
|
|
|
|
$logger = new LoggerService();
|
|
$logger->insertLog($data);
|
|
}
|
|
}
|