summaryrefslogtreecommitdiff
path: root/src/App.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2022-01-02 13:57:40 +0100
committerDaniel Weipert <code@drogueronin.de>2022-01-10 11:29:13 +0100
commitda0d49a8472a3472ed24c99ed08435bf43a2ca3f (patch)
tree0e4728c2029347c157913e9e4ba37e634a95ad1e /src/App.php
parent7783aeb63ec08bed159942fb0df100cfc4e93d3c (diff)
Add config and make configurable
Diffstat (limited to 'src/App.php')
-rw-r--r--src/App.php6
1 files changed, 3 insertions, 3 deletions
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;
}