xref: /plugin/bez/cron-daily.php (revision 92a18be19fd2db4400516e31e703300e7c0ac366)
1<?php
2
3//include base config
4$inc = realpath(__DIR__.'/../../..');
5define('DOKU_INC', $inc.'/');
6
7// load and initialize the core system
8require_once(DOKU_INC.'inc/init.php');
9
10if (empty($conf['baseurl'])) {
11    echo "set baseurl in dokuwiki config: ${conf['basedir']}\n";
12    exit(-1);
13}
14
15require_once 'cron/functions.php';
16
17$errors = [];
18try {
19    if (date('l') === $conf['plugin']['bez']['weekly_cron_day_of_the_week']) {
20        send_weekly_message();
21    }
22
23    send_task_reminder();
24    send_inactive_issue();
25} catch (Exception $e) {
26    $errors[] = $e->getMessage();
27}
28
29if ($errors) {
30    echo $conf['baseurl'] . ":\n";
31    echo implode("\n", $errors);
32    echo "\n";
33    exit(-1);
34}
35
36