public function readme($filename)
{
$filename = $this->resources()->getPath("extensions/{$filename}");
// Don't allow viewing of anything but "readme.md" files.
if (strtolower(basename($filename)) != 'readme.md') {
$this->abort(Response::HTTP_UNAUTHORIZED, 'Not allowed');
}
if (!is_readable($filename)) {
$this->abort(Response::HTTP_UNAUTHORIZED, 'Not readable');
}
$readme = file_get_contents($filename);
// Parse the field as Markdown, return HTML
$html = $this->app['markdown']->text($readme);
$response = new Response($html);
$response->setSharedMaxAge(180)->setPublic();
return $response;
}