/** * Show Git commit diff. * * @Route("s/{currentDir}",defaults={"$currentDir" = ""}, name="project_filelist") * @Method("GET") * @Template() * @ProjectAccess(grantType="VIEW") */ public function fileListAction($id, $currentDir = '') { $dir = ''; if ($currentDir) { $dir = trim(urldecode($currentDir)); } $files = $this->gitFilesCommands->listFiles($dir, $this->branchName); $readme = ''; foreach ($files as $file) { if (strtolower($file->getExtension()) == 'md' || strtolower($file->getExtension()) == 'markdown') { $readme = $this->gitFilesCommands->readFile($file); break; } } return array_merge($this->viewVariables, array('files' => $files, 'currentDir' => $dir, 'readme' => $readme)); }