Add null variables

This commit is contained in:
2021-01-27 16:43:36 +03:00
parent 0ada203f11
commit e1fa0ececb

View File

@@ -30,6 +30,7 @@ class HRCCommand extends Command
private function prepareInput()
{
if($this->argument('source') != 'null') {
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
$data = parse_ini_file($source_file);
@@ -40,23 +41,30 @@ class HRCCommand extends Command
return $data;
}
return [];
}
private function prepareOutput()
{
if($this->argument('source') != 'null') {
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
$data = parse_ini_file($source_file);
if (isset($data['raw_result'])) {
return json_decode(base64_decode($data['raw_result']), true);
}
}
return null;
}
public function save($result)
{
if($this->argument('result') != 'null') {
$result_file = CORE_PATH . '/temp/' . $this->argument('result');
file_put_contents($result_file, json_encode($result));
}
}
private function getCoreConfig($name, $default = null)
{