fdeb4899725e2785bb3ca24fc0afbdb5970f8284
[Packages/TYPO3.CMS.git] / typo3 / sysext / reports / tasks / class.tx_reports_tasks_systemstatusupdatetask.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Ingo Renner <ingo@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25
26 /**
27 * A task that should be run regularly to determine the system's status.
28 *
29 * @author Ingo Renner <ingo@typo3.org>
30 * @package TYPO3
31 * @subpackage reports
32 */
33 class tx_reports_tasks_SystemStatusUpdateTask extends tx_scheduler_Task {
34
35 /**
36 * Executes the System Status Update task, determing the highest severity of
37 * status reports and saving that to the registry to be displayed at login
38 * if necessary.
39 *
40 * @see typo3/sysext/scheduler/tx_scheduler_Task::execute()
41 */
42 public function execute() {
43 $registry = t3lib_div::makeInstance('t3lib_Registry');
44 $statusReport = t3lib_div::makeInstance('tx_reports_reports_Status');
45
46 $systemStatus = $statusReport->getSystemStatus();
47 $highestSeverity = $statusReport->getHighestSeverity($systemStatus);
48
49 $registry->set('tx_reports', 'status.highestSeverity', $highestSeverity);
50
51 return true;
52 }
53 }
54
55
56 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php'])) {
57 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php']);
58 }
59
60 ?>