From c810876aa4064d5f05b9957dd6228e16fd3f8d3e Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Mon, 11 Mar 2024 23:30:25 +0100 Subject: [PATCH] Bugfix config loading from phar --- src/Configuration.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Configuration.php b/src/Configuration.php index a3c0a48..2437b4b 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -23,7 +23,12 @@ class Configuration { $config = new Configuration(); - $yaml = Yaml::parseFile($file); + $file = realpath($file); + if (!file_exists($file)) { + throw new \Exception("Configuration file not found"); + } + $data = file_get_contents($file); + $yaml = Yaml::parse($data); if (isset($yaml['security'])) { $security = $yaml['security'];