public function installInfo(Request $request)
{
$package = $request->get('package');
$versions = ['dev' => [], 'stable' => []];
try {
$info = $this->app['extend.info']->info($package, Bolt\Version::forComposer());
} catch (\Exception $e) {
return $this->getJsonException($e);
}
if (isset($info->version) && is_array($info->version)) {
foreach ($info->version as $version) {
$versions[$version->stability][] = $version;
}
}
return $this->json($versions);
}