From 5e12b93756a3dc8382c579cf4f44cb8ef6b216f0 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 11 May 2022 23:58:26 +0200 Subject: [PATCH] Fix: Don't use absolute path to config outside of docker --- src/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.php b/src/index.php index 1c7d010..83f308b 100644 --- a/src/index.php +++ b/src/index.php @@ -16,7 +16,7 @@ class SyncedTimer private $_basepath; private $_resourcePath; private $_path; - private $_dataFile = "/config/data/data.json"; + private $_dataFile; private $_storageHelper; public function __construct($translations) @@ -24,6 +24,7 @@ class SyncedTimer session_start(); $this->_translations = $translations; + $this->_dataFile = file_exists("/.dockerenv") ? "/config/data/data.json":"./data.json"; $this->_storageHelper = new StorageHelper($this->_dataFile); $this->_calculateBasepath();