refactor chdir() call

This commit is contained in:
Art4 2024-12-25 20:43:15 +00:00
parent 7d10d04768
commit b94697678e

View file

@ -50,19 +50,7 @@ use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Security\ExAuth;
use Psr\Log\LoggerInterface;
if (sizeof($_SERVER["argv"]) == 0) {
die();
}
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR) {
$directory = $_SERVER["PWD"] . DIRECTORY_SEPARATOR . $directory;
}
$directory = realpath($directory . DIRECTORY_SEPARATOR . "..");
chdir($directory);
chdir(dirname(__FILE__, 2));
require dirname(__DIR__) . '/vendor/autoload.php';