Update install.php

This commit is contained in:
Roman Kelesidis 2024-08-08 00:00:45 +07:00
commit 4f53eefbe4

View file

@ -40,7 +40,7 @@ function out(string $str, string $type = ''): void
'warning' => "\033[33m$str \033[0m\n", 'warning' => "\033[33m$str \033[0m\n",
'info' => "\033[36m$str \033[0m\n", 'info' => "\033[36m$str \033[0m\n",
'debug' => "\033[90m$str \033[0m\n", 'debug' => "\033[90m$str \033[0m\n",
default => $str, default => "$str\n",
}; };
} }
@ -106,13 +106,13 @@ function chmod_r(string $dir, int $dirPermissions, int $filePermissions): void
continue; continue;
} }
$fullPath = $dir . '/' . $file; $fullPath = realpath($dir . '/' . $file);
if (is_dir($fullPath)) { if (is_dir($fullPath)) {
out('- Directory:' . $fullPath); out("- Directory: $fullPath");
chmod($fullPath, $dirPermissions); chmod($fullPath, $dirPermissions);
chmod_r($fullPath, $dirPermissions, $filePermissions); chmod_r($fullPath, $dirPermissions, $filePermissions);
} elseif (is_file($fullPath)) { } elseif (is_file($fullPath)) {
out('- File:' . $fullPath); out("- File: $fullPath");
chmod($fullPath, $filePermissions); chmod($fullPath, $filePermissions);
} else { } else {
out("- Cannot find target path: $fullPath", 'error'); out("- Cannot find target path: $fullPath", 'error');