diff --git a/index.php b/index.php index 7fed0dc..05c8336 100644 --- a/index.php +++ b/index.php @@ -37,8 +37,6 @@ /* * For servers without cron, enable "poormanscron" * ⚠️ Ugly, non-performant hack to bypass cache - * @TODO: Fix this as soon as this is possible: - * https://github.com/getkirby/ideas/issues/23 */ if (option("bvdputte.kirbyAutopublish.poormanscron")) { bvdputte\kirbyAutopublish\Autopublish::poorManCronRun(); diff --git a/readme.md b/readme.md index 9776193..74dfa51 100644 --- a/readme.md +++ b/readme.md @@ -23,6 +23,7 @@ It is built to work with enabled cache. Add the worker file `site/plugins/kirby-autopublish/worker.php` to [cron](https://en.wikipedia.org/wiki/Cron) or similar at the desired interval (.e.g. each minute). 💡 This is the preferred method for setting up kirby-autopublish. +⚠️ There is a [demo worker file](https://github.com/bvdputte/kirby-autopublish/blob/master/worker.php) included in the plugin that should work with the Kirby default folder setup. In case you use a [custom folder setup](https://getkirby.com/docs/guide/configuration#custom-folder-setup), please copy the worker an adjust the paths to match your installation. #### 2. Poor man's cron diff --git a/worker.php b/worker.php index 709d493..7fa2c59 100644 --- a/worker.php +++ b/worker.php @@ -3,8 +3,8 @@ use bvdputte\kirbyAutopublish\Autopublish; // Bootstrap Kirby (from with the plugin's folder) -require '../../../kirby/bootstrap.php'; -$kirbyPath = dirname(__FILE__) . "/../../../../"; +$projectRoot = dirname(__DIR__) . '/../../'; +require $projectRoot . 'kirby/bootstrap.php'; // Instantiate Kirby $kirby = new Kirby([ @@ -12,7 +12,9 @@ 'debug' => true, ], 'roots' => [ - 'kirby' => $kirbyPath + 'kirby' => $projectRoot . 'kirby', + // 'content' => $projectRoot. 'content', + // 'site' => $projectRoot. 'site', ], ]);