refactor chdir() call

This commit is contained in:
Art4 2024-12-28 22:39:20 +00:00
parent 126ec1977b
commit bb0900093d

View file

@ -23,16 +23,7 @@ if (php_sapi_name() !== 'cli') {
}
// Ensure that Jetstream.php is executed from the base path of the installation
if (!file_exists('index.php') && (sizeof((array)$_SERVER['argv']) != 0)) {
$directory = dirname($_SERVER['argv'][0]);
if (substr($directory, 0, 1) != '/') {
$directory = $_SERVER['PWD'] . '/' . $directory;
}
$directory = realpath($directory . '/..');
chdir($directory);
}
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';