kirby-queue icon indicating copy to clipboard operation
kirby-queue copied to clipboard

Reliable way of linking to kirby folder & kirby bootstrap file

Open bvdputte opened this issue 6 years ago • 1 comments

In worker.php, bootstrap.php and the path to the Kirby folder are based on the default locations and cannot be altered.

This will give problems to people who have a non-default folder setup, or use composer.

Find a way to make this better.

bvdputte avatar Apr 12 '19 07:04 bvdputte

One solution, at least for the cron usage, would be setting the cron with an argument, like /var/whatever/worker.php /../path/to/root/, and then using the (optional) argument when requiring bootstrap.php, like this:

$kirbyPath = __DIR__ . (count($argv) > 1 ? $argv[1] : '/../../../../');
require "{$kirbyPath}kirby/bootstrap.php";

adamkiss avatar Jun 12 '19 10:06 adamkiss