From 40927178f4658fb36aef2542d9f1c5c252235dc3 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 11:56:25 +0000 Subject: [PATCH] refactor chdir() in worker.php --- bin/worker.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bin/worker.php b/bin/worker.php index 29fd5a4fb7..668e99f904 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -28,16 +28,7 @@ $longopts = ['spawn', 'no_cron']; $options = getopt($shortopts, $longopts); // Ensure that worker.php is executed from the base path of the installation -if (!file_exists("index.php") && (sizeof($_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';