30 lines
850 B
PHP
30 lines
850 B
PHP
<?php
|
|
|
|
namespace App\Commands;
|
|
|
|
use App\Component\Models\Filesystem;
|
|
use App\Console\Commands\HRCCommand;
|
|
use App\Console\Commands\HRCCommandInterface;
|
|
|
|
class GETClearCache extends HRCCommand implements HRCCommandInterface
|
|
{
|
|
protected $signature = 'getclearcache';
|
|
const cacheFolder = CORE_PATH . '/../../Cache/';
|
|
|
|
public function command($input, $output = null)
|
|
{
|
|
$code = Filesystem::GetCode($input['token']);
|
|
if (isset($input['folder'])) {
|
|
Filesystem::ClearFolder(self::cacheFolder . $code . '/' . $input['folder']);
|
|
return [
|
|
'status' => 'success',
|
|
];
|
|
}
|
|
if (!isset($input['folder'])) {
|
|
Filesystem::ClearFolder(self::cacheFolder . $code . '/');
|
|
return [
|
|
'status' => 'success',
|
|
];
|
|
}
|
|
}
|
|
} |