]> git.mxchange.org Git - friendica.git/commitdiff
Refactor chdir() call
authorArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:05:50 +0000 (09:05 +0000)
committerArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:05:50 +0000 (09:05 +0000)
bin/daemon.php

index 6b62039ee764b30462e14075aa9338376e84b279..dcb668acd6464fad99fb2ac4bc4f741a216e6866 100755 (executable)
@@ -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';