18 require_once SQ_CORE_PACKAGE_PATH.
'/system/cron/cron_job/cron_job.inc';
19 require_once SQ_INCLUDE_PATH.
'/workflow_manager.inc';
20 require_once SQ_FUDGE_PATH.
'/general/datetime.inc';
48 parent::__construct($assetid);
66 require_once SQ_CORE_PACKAGE_PATH.
'/system/system_asset_fns.inc';
67 if (!system_asset_fns_create_pre_check($this)) {
70 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
71 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
73 if ($linkid = parent::create($link)) {
74 if (!system_asset_fns_create_cleanup($this)) {
80 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
82 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
85 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
102 return translate(
'cron_job_generate_log_reports');
150 if (substr(PHP_OS, 0, 3) !=
'WIN') $old_mask = umask(0113);
152 $lm = $GLOBALS[
'SQ_SYSTEM']->getLogManager();
154 $rotated_logs = $lm->rotateLogs();
157 if (empty($rotated_logs))
return SQ_CRON_JOB_COMPLETED;
162 if (isset($old_mask)) umask($old_mask);
164 return SQ_CRON_JOB_COMPLETED;
179 if (empty($target_logs))
return FALSE;
181 if (!$GLOBALS[
'SQ_SYSTEM']->am->installed(
'log_report')) {
185 $log_reports = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'log_report', FALSE, TRUE);
188 $lm = $GLOBALS[
'SQ_SYSTEM']->getLogManager();
189 $logs = $lm->getLogs();
190 foreach ($target_logs as $logname) {
191 if (isset($logs[$logname])) {
212 if (empty($log_reports))
return FALSE;
215 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
217 foreach ($log_reports as $reportid => $info) {
218 $report_type = $info[
'type_code'];
219 $report = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($reportid, $report_type);
220 if ($report->logname == $logname) {
222 'assetid' => $reportid,
225 $status = $hh->freestyleHIPO(
'hipo_job_generate_report', $vars);
246 $res = parent::run();
247 if ($res & SQ_CRON_JOB_REMOVE) {
248 $res = $res & -SQ_CRON_JOB_REMOVE;