Add null variables
This commit is contained in:
@@ -30,23 +30,29 @@ class HRCCommand extends Command
|
|||||||
|
|
||||||
private function prepareInput()
|
private function prepareInput()
|
||||||
{
|
{
|
||||||
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
if($this->argument('source') != 'null') {
|
||||||
$data = parse_ini_file($source_file);
|
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
||||||
|
$data = parse_ini_file($source_file);
|
||||||
|
|
||||||
if(isset($data['raw_result'])) {
|
if (isset($data['raw_result'])) {
|
||||||
unset($data['raw_result']);
|
unset($data['raw_result']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function prepareOutput()
|
private function prepareOutput()
|
||||||
{
|
{
|
||||||
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
if($this->argument('source') != 'null') {
|
||||||
$data = parse_ini_file($source_file);
|
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
||||||
|
$data = parse_ini_file($source_file);
|
||||||
|
|
||||||
if(isset($data['raw_result'])) {
|
if (isset($data['raw_result'])) {
|
||||||
return json_decode(base64_decode($data['raw_result']), true);
|
return json_decode(base64_decode($data['raw_result']), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -54,8 +60,10 @@ class HRCCommand extends Command
|
|||||||
|
|
||||||
public function save($result)
|
public function save($result)
|
||||||
{
|
{
|
||||||
$result_file = CORE_PATH . '/temp/' . $this->argument('result');
|
if($this->argument('result') != 'null') {
|
||||||
file_put_contents($result_file, json_encode($result));
|
$result_file = CORE_PATH . '/temp/' . $this->argument('result');
|
||||||
|
file_put_contents($result_file, json_encode($result));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCoreConfig($name, $default = null)
|
private function getCoreConfig($name, $default = null)
|
||||||
|
|||||||
Reference in New Issue
Block a user