diff --git a/setup/cli/modules/cron.php b/setup/cli/modules/cron.php new file mode 100644 index 0000000000000000000000000000000000000000..724c06caca04c3fd2e6870c6896052727a3e8431 --- /dev/null +++ b/setup/cli/modules/cron.php @@ -0,0 +1,34 @@ +<?php +require_once dirname(__file__) . "/class.module.php"; +require_once dirname(__file__) . "/../cli.inc.php"; + +class CronManager extends Module { + var $prologue = 'CLI cron manager for osTicket'; + + var $arguments = array( + 'action' => array( + 'help' => 'Action to be performed', + 'options' => array( + 'fetch' => 'Fetch email', + 'search' => 'Build search index' + ), + ), + ); + + function run($args, $options) { + Bootstrap::connect(); + $ost = osTicket::start(); + + switch (strtolower($args[0])) { + case 'fetch': + Cron::MailFetcher(); + break; + case 'search': + $ost->searcher->backend->IndexOldStuff(); + break; + } + } +} + +Module::register('cron', 'CronManager'); +?>