/** * Registers the functions that are required by the indexing sub-system. * */ function registerIndexingTasks() { $ext = OS_WINDOWS ? 'bat' : 'sh'; $year = date('Y'); $mon = date('m'); $day = date('d'); $hour = date('H'); $min = date('i'); $min = floor($min / 5) * 5; $oScheduler = new Scheduler('Indexing'); $oScheduler->setScriptPath(KT_DIR . '/bin/indexingTask.' . $ext); $oScheduler->setFrequency('1min'); $oScheduler->setFirstRunTime(date('Y-m-d H:i', mktime($hour, $min, 0, $mon, $day, $year))); $oScheduler->registerTask(); $oScheduler = new Scheduler('Index Migration'); $oScheduler->setScriptPath(KT_DIR . '/bin/indexMigrationTask.' . $ext); $oScheduler->setFrequency('5mins'); $oScheduler->setFirstRunTime(date('Y-m-d H:i', mktime($hour, $min, 0, $mon, $day, $year))); $oScheduler->registerTask(); $oScheduler = new Scheduler('Index Optimisation'); $oScheduler->setScriptPath(KT_DIR . '/bin/optimizeIndexes.' . $ext); $oScheduler->setFrequency('weekly'); $oScheduler->setFirstRunTime(date('Y-m-d 00:00')); $oScheduler->registerTask(); }