Files
admin-php-module/commands/GETKeyInfo.php
miroman-afk fb46c8e739 v.2.27
Fixed reports
2023-05-02 15:21:54 +03:00

39 lines
1.1 KiB
PHP

<?php
namespace App\Commands;
use App\Component\Models\Cache;
use App\Console\Commands\HRCEncryptor;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
use Illuminate\Support\Facades\Log;
class GETKeyInfo extends HRCCommand implements HRCCommandInterface
{
protected $signature = 'getkeyinfo';
public function command($input, $output = null)
{
$cache = Cache::get(245817422, 'v1', $input);
if ($cache) {
return [
'status' => 'success',
'info' => $cache,
'input' => $input
];
}
$info_file = __DIR__ . "\\..\\..\\..\\info.ini";
$key_file = __DIR__ . "\\..\\..\\..\\Key.key";
$unn = parse_ini_file($info_file);
$unn = intval($unn['unn']);
$info = json_decode(HRCEncryptor::decrypt(file_get_contents($key_file), $unn), true);
if (!$cache) {
$cache = Cache::store(245817422, 'v1', $input, $info);
}
return [
'status' => 'success',
'info' => $cache,
'input' => $input
];
}
}