projectDirectory = $projectDirectory; } /** * @Route(path="", name="about", methods={"GET"}) */ public function license(): Response { $filename = $this->projectDirectory . '/LICENSE'; try { $license = file_get_contents($filename); } catch (\Exception $ex) { $this->logException($ex); $license = false; } if (false === $license) { $license = 'Failed reading license file: ' . $filename . '. ' . 'Check this instead: ' . Constants::GITHUB . 'blob/master/LICENSE'; } return $this->render('about/license.html.twig', [ 'license' => $license ]); } }