Commit 88795cdd authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #7714: autocron fails to open logfiles - adjust CWD based on argv(0).

parent 7f9fcf8b
Pipeline #1449 passed with stage
in 2 minutes and 9 seconds
......@@ -18,6 +18,20 @@ try {
$verbose = true;
}
// If this script is started via an absolute path: set CWD to the T3 installation directory
if ($argv[0][0] == '/') {
$baseDir='';
// /var/www/html/typo3conf/ext/qfq/Source/external/autocron.php
$arr = explode('/', $argv[0]);
$cnt = count($arr) - 6; // Strip the last '6' entries, these are below T3 basedir until this script.
for ($ii = 0; $ii < $cnt; $ii++) {
if($arr[$ii]!='') {
$baseDir .= '/' . $arr[$ii];
}
}
chdir($baseDir);
}
$autoCron = new \qfq\AutoCron($verbose);
$autoCron->process();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment