From da0d49a8472a3472ed24c99ed08435bf43a2ca3f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 2 Jan 2022 13:57:40 +0100 Subject: Add config and make configurable --- src/App.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/App.php b/src/App.php index fcf2699..7e0cabd 100644 --- a/src/App.php +++ b/src/App.php @@ -20,7 +20,7 @@ class App $content = [ 'data' => [], ]; - $contentRoot = dirname(__DIR__) . '/content'; + $contentRoot = $_ENV['app']['contentFolderPath']; $method = $request->getMethod(); $path = $request->getPathInfo(); @@ -85,7 +85,7 @@ class App $builder->addValue($entryKey, $entryValue); } - $entryDirectory = $formPath . '/entries/' . $date->format('Y/m/d'); + $entryDirectory = $formPath . '/' . $_ENV['form']['entriesFolderName'] . '/' . $date->format('Y/m/d'); @mkdir($entryDirectory, 0774, true); $entryFilename = $date->format('Ymd_Hi_') . hash('adler32', serialize($entry)) . '.toml'; file_put_contents( @@ -158,7 +158,7 @@ class App $config['api']['keys'] = $apiKeys; } - if (str_ends_with($currentFolder, '/content') || $currentFolder == '/') { + if (str_ends_with($currentFolder, '/' . basename($_ENV['app']['contentFolderPath'])) || $currentFolder == '/') { break; } -- cgit v1.2.3