/** * Mainline for export processing * * @param int $targetstarttime The timestamp representing the theoretical * time when this task was meant to be run * @param int $lastruntime The last time the export was run * (required for incremental scheduled export) * @param int $maxruntime The max time in seconds to complete export * default: 0 => unlimited * @param object $state Previous ran state data to continue from * (currently not used for export) * @return mixed object Current state of export processing * or null on success! * ->result false on error, i.e. time limit exceeded. */ public function run($targetstarttime = 0, $lastruntime = 0, $maxruntime = 0, $state = null) { $result = parent::run($targetstarttime, $lastruntime, $maxruntime, $state); if (!defined('PHPUnit_MAIN_METHOD')) { // Not in a unit test, so send out log files in a zip. $logids = $this->dblogger->get_log_ids(); rlip_send_log_emails('dhexport_version1elis', $logids, $this->manual); } return $result; }
/** * Mainline for running the import * * @param int $targetstarttime The timestamp representing the theoretical * time when this task was meant to be run * @param int $lastruntime The last time the export was run * (N/A for import) * @param int $maxruntime The max time in seconds to complete import * default: 0 => unlimited time * @param object $state Previous ran state data to continue from * * @return object State data to pass back on re-entry, * null on success! * ->result false on error, i.e. time limit exceeded. */ function run($targetstarttime = 0, $lastruntime = 0, $maxruntime = 0, $state = null) { global $CFG; require_once $CFG->dirroot . '/local/datahub/lib.php'; $result = parent::run($targetstarttime, $lastruntime, $maxruntime, $state); if (!defined('PHPUnit_MAIN_METHOD')) { //not in a unit test, so send out log files in a zip $logids = $this->dblogger->get_log_ids(); rlip_send_log_emails('dhimport_version1elis', $logids, $this->manual); } return $result; }