Closed fabian-mcfly closed 1 year ago
A solution could be
$pos = strpos($path, 'src/Queue/Task/');
if ($pos) {
$name = substr($path, $pos + strlen('src/Queue/Task/'), -8);
}
else {
$pos = strpos($path, APP_DIR . '/Queue/Task/');
if (!$pos) {
continue;
}
$name = substr($path, $pos + strlen(APP_DIR . '/Queue/Task/'), -8);
}
What case would have them not in src/ ? Can u make a PR?
Introduced with changes for the issue https://github.com/dereuromark/cakephp-queue/issues/371 ("Organize task in sub folders"), the following code breaks when the app source code is not inside of the folder "src". For plugins this works fine but for the base application the constant "APP_DIR" must be used.
https://github.com/dereuromark/cakephp-queue/blob/26014bfaa211fd34a5f3cdff434a00b311cb1932/src/Queue/TaskFinder.php#L96-L100
Sorry :o