public function getDetails(string $type, string $supplier, string $name) : array
{
$package = $this->db->row('SELECT
*
FROM
airship_package_cache
WHERE
packagetype = ?
AND supplier = ?
AND name = ?
', $type, $supplier, $name);
if (empty($package)) {
return [];
}
if (empty($package['skyport_metadata'])) {
$package['skyport_metadata'] = [];
} else {
$package['skyport_metadata'] = \json_decode($package['skyport_metadata'], true);
}
$package['versions'] = $this->getNewVersions($package);
return $package;
}
/** * @route ajax/admin/skyport/view */ public function ajaxViewPackageInfo() { $expected = ['package', 'supplier', 'type']; if (!\Airship\all_keys_exist($expected, $_POST)) { echo 'Invalid POST request.', "\n"; return; } $this->lens('skyport/view', ['package' => $this->skyport->getDetails($_POST['type'], $_POST['supplier'], $_POST['package']), 'skyport_url' => $this->skyport->getURL($_POST['type'], $_POST['supplier'], $_POST['package'])]); }