summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2022-01-02 16:39:43 +0100
committerDaniel Weipert <code@drogueronin.de>2022-01-10 11:29:13 +0100
commit976df6c8f88cb86ab713528b1c6f2ce3b91f6000 (patch)
tree5cb969cb72479c527c79be6de42ebdd7d84e99bc
parent9665f430438413391a9a8272d72fccbbe6c7b272 (diff)
Rename folder variables to directory
-rw-r--r--public/index.php14
-rw-r--r--src/App.php8
2 files changed, 11 insertions, 11 deletions
diff --git a/public/index.php b/public/index.php
index b7895e7..3d82924 100644
--- a/public/index.php
+++ b/public/index.php
@@ -7,14 +7,14 @@ require_once dirname(__DIR__) . '/vendor/autoload.php';
function findAppConfigFile($path)
{
- $currentFolder = $path;
- while ($currentFolder !== '/') {
- $configFile = $currentFolder . '/config.toml';
+ $currentDirectory = $path;
+ while ($currentDirectory !== '/') {
+ $configFile = $currentDirectory . '/config.toml';
if (file_exists($configFile)) {
return $configFile;
}
- $currentFolder = dirname($currentFolder);
+ $currentDirectory = dirname($currentDirectory);
}
die('config.toml missing');
@@ -24,9 +24,9 @@ $configFile = findAppConfigFile(dirname(__DIR__));
$config = Toml::parseFile($configFile);
chdir(dirname($configFile));
-$contentFolderPath = realpath($config['app']['contentFolderPath']);
-$contentFolderPath === false && die('Content folder "' . $config['app']['contentFolderPath'] . '" missing');
-$config['app']['contentFolderPath'] = $contentFolderPath;
+$contentDirectoryPath = realpath($config['app']['contentFolderPath']);
+$contentDirectoryPath === false && die('Content folder "' . $config['app']['contentFolderPath'] . '" missing');
+$config['app']['contentFolderPath'] = $contentDirectoryPath;
chdir($_SERVER['DOCUMENT_ROOT']);
foreach ($config as $key => $value) {
diff --git a/src/App.php b/src/App.php
index b2c877e..b270b02 100644
--- a/src/App.php
+++ b/src/App.php
@@ -256,9 +256,9 @@ class App
public function buildConfig($formPath)
{
$config = [];
- $currentFolder = $formPath;
+ $currentDirectory = $formPath;
while (true) {
- $configFile = $currentFolder . '/config/config.toml';
+ $configFile = $currentDirectory . '/config/config.toml';
if (file_exists($configFile)) {
$parsedConfig = Toml::parseFile($configFile);
@@ -267,11 +267,11 @@ class App
$config['api']['keys'] = $apiKeys;
}
- if (str_ends_with($currentFolder, '/' . basename($_ENV['app']['contentFolderPath'])) || $currentFolder == '/') {
+ if (str_ends_with($currentDirectory, '/' . basename($_ENV['app']['contentFolderPath'])) || $currentDirectory == '/') {
break;
}
- $currentFolder = dirname($currentFolder);
+ $currentDirectory = dirname($currentDirectory);
}
return $config;