mirror of
https://github.com/friendica/friendica
synced 2025-01-08 20:04:43 +00:00
refactor chdir() in worker.php
This commit is contained in:
parent
894cd5814f
commit
40927178f4
1 changed files with 1 additions and 10 deletions
|
@ -28,16 +28,7 @@ $longopts = ['spawn', 'no_cron'];
|
||||||
$options = getopt($shortopts, $longopts);
|
$options = getopt($shortopts, $longopts);
|
||||||
|
|
||||||
// Ensure that worker.php is executed from the base path of the installation
|
// Ensure that worker.php is executed from the base path of the installation
|
||||||
if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
chdir(dirname(__DIR__));
|
||||||
$directory = dirname($_SERVER["argv"][0]);
|
|
||||||
|
|
||||||
if (substr($directory, 0, 1) != '/') {
|
|
||||||
$directory = $_SERVER["PWD"] . '/' . $directory;
|
|
||||||
}
|
|
||||||
$directory = realpath($directory . '/..');
|
|
||||||
|
|
||||||
chdir($directory);
|
|
||||||
}
|
|
||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue