]> git.mxchange.org Git - friendica.git/commitdiff
refactor chdir() call
authorArt4 <art4@wlabs.de>
Sat, 28 Dec 2024 22:39:20 +0000 (22:39 +0000)
committerArt4 <art4@wlabs.de>
Sat, 28 Dec 2024 22:39:20 +0000 (22:39 +0000)
bin/jetstream.php

index c4075ff652763f9b72dfe6ad9e7efe4825073ccc..9764c38e51593afc67a90dd104f5592da6967355 100755 (executable)
@@ -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';