Extract info from composer

This commit is contained in:
2021-01-27 16:54:21 +03:00
parent 17370290e0
commit 1b2c714611

View File

@@ -10,13 +10,13 @@ class HRCInfo extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null)
{
$info = parse_ini_file(CORE_PATH . '/module.ini');
$info = array_change_key_case($info, true);
$info = json_decode(CORE_PATH . '/composer.json', true);
return [
'status' => 'success',
'version' => $info['info']['version'] ?? '0.0',
'is_release' => (int)(!$info['info']['is_debug'] ?? true)
'version' => $info['version'] ?? '0.0',
'name' => $info['name'],
'is_release' => true
];
}
}