Added feature #16338: Scheduler task to regularly execute the status report checks
authorIngo Renner <ingo.renner@typo3.org>
Fri, 12 Nov 2010 23:00:39 +0000 (23:00 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Fri, 12 Nov 2010 23:00:39 +0000 (23:00 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9358 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/reports/ChangeLog
typo3/sysext/reports/ext_autoload.php
typo3/sysext/reports/ext_localconf.php
typo3/sysext/reports/reports/locallang.xml
typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php [new file with mode: 0644]

index f6f0092..2cc6892 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-11-12  Ingo Renner  <ingo@typo3.org>
 
        * Added feature #16337: System health status self monitoring
+       * Added feature #16338: Scheduler task to regularly execute the status report checks
 
 2010-11-12  Steffen Gebert  <steffen@steffen-gebert.de>
 
index 38a9dd7..6168242 100644 (file)
@@ -1,6 +1,7 @@
 2010-11-12  Ingo Renner  <ingo@typo3.org>
 
        * Added feature #16337: System health status self monitoring
+       * Added feature #16338: Scheduler task to regularly execute the status report checks
 
 2009-09-18  Ingo Renner  <ingo@typo3.org>
 
index f141bab..76c885b 100644 (file)
@@ -15,5 +15,6 @@ return array(
        'tx_reports_reports_status_securitystatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_securitystatus.php',
        'tx_reports_reports_status_configurationstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_configurationstatus.php',
        'tx_reports_reports_status_status' => $extensionPath . 'reports/status/class.tx_reports_reports_status_status.php',
+       'tx_reports_tasks_systemstatusupdatetask' => $extensionPath . 'tasks/class.tx_reports_tasks_systemstatusupdatetask.php',
 );
 ?>
\ No newline at end of file
index 22dd57f..3141a2c 100644 (file)
@@ -5,6 +5,12 @@ if (!defined ('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_reports_tasks_SystemStatusUpdateTask'] = array(
+       'extension'   => $_EXTKEY,
+       'title'       => 'LLL:EXT:' . $_EXTKEY . '/reports/locallang.xml:status_updateTaskTitle',
+       'description' => 'LLL:EXT:' . $_EXTKEY . '/reports/locallang.xml:status_updateTaskDescription'
+);
+
 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages']['tx_reports_WarningMessagePostProcessor'] = 'EXT:reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php:tx_reports_reports_status_WarningMessagePostProcessor';
 
 ?>
\ No newline at end of file
index fdd6544..05ecb75 100644 (file)
@@ -19,6 +19,8 @@
                        <label index="status_connectionFailed">Connection Failed</label>
                        <label index="status_updateComplete">Update Complete</label>
                        <label index="status_updateIncomplete">Update Incomplete</label>
+                       <label index="status_updateTaskTitle">System Status Update</label>
+                       <label index="status_updateTaskDescription">Runs a system status check and sends notifications if problems have been found.</label>
                        <label index="status_problemNotification">One or more problems were detected with your TYPO3 installation. Please check the %sstatus report%s for more information.</label>
                        <label index="status_typo3">TYPO3 System</label>
                        <label index="status_system">System</label>
diff --git a/typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php b/typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php
new file mode 100644 (file)
index 0000000..9051f8a
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Ingo Renner <ingo@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+/**
+ * A task that should be run regularly to determine the system's status.
+ *
+ * @author     Ingo Renner <ingo@typo3.org>
+ * @package TYPO3
+ * @subpackage reports
+ */
+class tx_reports_tasks_SystemStatusUpdateTask extends tx_scheduler_Task {
+
+       /**
+        * Executes the System Status Update task, determing the highest severity of
+        * status reports and saving that to the registry to be displayed at login
+        * if necessary.
+        *
+        * @see typo3/sysext/scheduler/tx_scheduler_Task::execute()
+        */
+       public function execute() {
+               $registry     = t3lib_div::makeInstance('t3lib_Registry');
+               $statusReport = t3lib_div::makeInstance('tx_reports_reports_Status');
+
+               $systemStatus    = $statusReport->getSystemStatus();
+               $highestSeverity = $statusReport->getHighestSeverity($systemStatus);
+
+               $registry->set('tx_reports', 'status.highestSeverity', $highestSeverity);
+
+               return true;
+       }
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php']);
+}
+
+?>
\ No newline at end of file