From 0cd2b8e2c0882eb9aa0b289d02d51a2ff42ddd14 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:05:50 +0000 Subject: [PATCH] Refactor chdir() call --- bin/daemon.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index 6b62039ee7..dcb668acd6 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -33,16 +33,7 @@ $longopts = ['foreground']; $options = getopt($shortopts, $longopts); // Ensure that daemon.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';