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) public function command($input, $output = null)
{ {
$info = parse_ini_file(CORE_PATH . '/module.ini'); $info = json_decode(CORE_PATH . '/composer.json', true);
$info = array_change_key_case($info, true);
return [ return [
'status' => 'success', 'status' => 'success',
'version' => $info['info']['version'] ?? '0.0', 'version' => $info['version'] ?? '0.0',
'is_release' => (int)(!$info['info']['is_debug'] ?? true) 'name' => $info['name'],
'is_release' => true
]; ];
} }
} }