1<?php 2 3function usage() { 4 echo "usage: cron-daily.php url user\n"; 5 exit(1); 6} 7 8if (count($argv) < 3) { 9 usage(); 10} 11 12$url = $argv[1]; 13 14$dw_user = $argv[2]; 15 16$url_p = parse_url($url); 17 18if (!isset($url_p['scheme'])) { 19 $_SERVER['HTTPS'] = 'on'; 20 21 $ex = explode('/', $url_p['path'], 2); 22 23 $_SERVER['SERVER_NAME'] = $ex[0]; 24 if (isset($ex[1])) { 25 $_SERVER['DOCUMENT_ROOT'] = $ex[1] . '/'; 26 } else { 27 $_SERVER['DOCUMENT_ROOT'] = '/'; 28 } 29 30} else { 31 if ($url_p['scheme'] === 'https') { 32 $_SERVER['HTTPS'] = 'on'; 33 } else { 34 $_SERVER['HTTPS'] = 'off'; 35 } 36 $_SERVER['SERVER_NAME'] = $url_p['host']; 37 $_SERVER['DOCUMENT_ROOT'] = $url_p['path'] . '/'; 38} 39 40//in case of $conf['basedir'] is empty 41$_SERVER['SCRIPT_NAME'] = $_SERVER['DOCUMENT_ROOT'].'doku.php'; 42 43$inc = realpath(__DIR__.'/../../..'); 44define('DOKU_INC', $inc.'/'); 45 46// load and initialize the core system 47require_once(DOKU_INC.'inc/init.php'); 48 49$INFO = array(); 50$INFO['client'] = $dw_user; 51require_once 'cron/functions.php'; 52 53if (date('l') === $conf['plugin']['bez']['weekly_cron_day_of_the_week']) { 54 send_weekly_message(); 55} 56 57send_one_day_task_reminder(); 58 59send_inactive_issue(); 60