[BUGFIX] Release scheduler from classname field
authorThomas Maroschik <tmaroschik@dfau.de>
Thu, 30 Aug 2012 21:57:38 +0000 (23:57 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Thu, 27 Sep 2012 16:21:54 +0000 (18:21 +0200)
Currently the scheduler depends at many parts on its classname field in
the tx_scheduler_task table. This is not necessary as the classname is
already stored in the serialized task object. By releasing scheduler
tasks from their classname field backwards compatibility is maintained
by the class_alias mechanism.

Change-Id: I26f228add1f3db9f99ec3f5691488bd453ae2339
Fixes: #40215
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14236
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Classes/Scheduler.php
typo3/sysext/scheduler/Classes/Task.php
typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php
typo3/sysext/scheduler/ext_localconf.php
typo3/sysext/scheduler/ext_tables.sql

index 0e1a6c7..5065b56 100644 (file)
@@ -38,14 +38,14 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
        /**
         * Back path to typo3 main dir
         *
-        * @var         string          $backPath
+        * @var string $backPath
         */
        public $backPath;
 
        /**
         * Array containing submitted data when editing or adding a task
         *
-        * @var         array           $submittedData
+        * @var array $submittedData
         */
        protected $submittedData = array();
 
@@ -53,12 +53,12 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         * Array containing all messages issued by the application logic
         * Contains the error's severity and the message itself
         *
-        * @var         array   $messages
+        * @var array $messages
         */
        protected $messages = array();
 
        /**
-        * @var         string  Key of the CSH file
+        * @var string Key of the CSH file
         */
        protected $cshKey;
 
@@ -157,7 +157,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                $content = '';
                $sectionTitle = '';
                // Get submitted data
-               $this->submittedData = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged('TYPO3\\CMS\\Scheduler\\Scheduler');
+               $this->submittedData = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged('tx_scheduler');
                $this->submittedData['uid'] = intval($this->submittedData['uid']);
                // If a save command was submitted, handle saving now
                if ($this->CMD == 'save') {
@@ -274,7 +274,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                        // Prepare necessary data for _cli_scheduler user creation
                        $password = md5(uniqid('scheduler', TRUE));
                        $data = array('be_users' => array('NEW' => array('username' => '_cli_scheduler', 'password' => $password, 'pid' => 0)));
-                       /** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tcemain */
+                       /** @var $tcemain \TYPO3\CMS\Core\DataHandling\DataHandler */
                        $tcemain = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
                        $tcemain->stripslashes_values = 0;
                        $tcemain->start($data, array());
@@ -309,7 +309,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                // Start generating the content
                $content = $GLOBALS['LANG']->getLL('msg.schedulerSetupCheck');
                // Display information about last automated run, as stored in the system registry
-               /** @var \TYPO3\CMS\Core\Registry $registry */
+               /** @var $registry \TYPO3\CMS\Core\Registry */
                $registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry');
                $lastRun = $registry->get('TYPO3\\CMS\\Scheduler\\Scheduler', 'lastRun');
                if (!is_array($lastRun)) {
@@ -392,7 +392,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                $registeredClasses = self::getRegisteredClasses();
                // No classes available, display information message
                if (count($registeredClasses) == 0) {
-                       /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
+                       /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('msg.noTasksDefined'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
                        $content .= $flashMessage->render();
                } else {
@@ -457,7 +457,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         * @return string Progress bar markup
         */
        protected function renderTaskProgressBar($progress) {
-               $progressText .= $GLOBALS['LANG']->getLL('status.progress') . ':&nbsp;' . $progress . '%';
+               $progressText = $GLOBALS['LANG']->getLL('status.progress') . ':&nbsp;' . $progress . '%';
                $progressBar = '<div class="progress"> <div class="bar" style="width: ' . $progress . '%;">' . $progressText . '</div> </div>';
                return $progressBar;
        }
@@ -484,7 +484,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                        }
                } catch (\UnexpectedValueException $e) {
                        // The task could not be unserialized properly, simply delete the database record
-                       $result = $GLOBALS['TYPO3_DB']->exec_DELETEquery('TYPO3\\CMS\\Scheduler\\Scheduler_task', 'uid = ' . intval($this->submittedData['uid']));
+                       $result = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_scheduler_task', 'uid = ' . intval($this->submittedData['uid']));
                        if ($result) {
                                $this->addMessage($GLOBALS['LANG']->getLL('msg.deleteSuccess'));
                        } else {
@@ -550,12 +550,11 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                /** @var $task \TYPO3\CMS\Scheduler\Task */
                                $task = unserialize($taskRecord['serialized_task_object']);
                                // Set some task information
-                               $class = $taskRecord['classname'];
                                $taskInfo['disable'] = $taskRecord['disable'];
                                // Check that the task object is valid
                                if ($this->scheduler->isValidTaskObject($task)) {
                                        // The task object is valid, process with fetching current data
-                                       $taskInfo['class'] = $class;
+                                       $taskInfo['class'] = get_class($task);
                                        // Get execution information
                                        $taskInfo['start'] = $task->getExecution()->getStart();
                                        $taskInfo['end'] = $task->getExecution()->getEnd();
@@ -578,7 +577,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                } else {
                                        // The task object is not valid
                                        // Issue error message
-                                       $this->addMessage(sprintf($GLOBALS['LANG']->getLL('msg.invalidTaskClassEdit'), $class), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                                       $this->addMessage(sprintf($GLOBALS['LANG']->getLL('msg.invalidTaskClassEdit'), get_class($task)), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                                        // Initialize empty values
                                        $taskInfo['start'] = 0;
                                        $taskInfo['end'] = 0;
@@ -831,7 +830,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                } catch (\OutOfBoundsException $e) {
                                        $this->addMessage(sprintf($GLOBALS['LANG']->getLL('msg.taskNotFound'), $uid), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                                } catch (\UnexpectedValueException $e) {
-                                       $this->addMessage(sprintf($GLOBALS['LANG']->getLL('msg.executionFailed'), $name, $e->getMessage()), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                                       $this->addMessage(sprintf($GLOBALS['LANG']->getLL('msg.executionFailed'), $uid, $e->getMessage()), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                                }
                        }
                        // Record the run in the system registry
@@ -863,7 +862,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                $numRows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
                // No tasks defined, display information message
                if ($numRows == 0) {
-                       /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
+                       /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('msg.noTasks'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
                        $content .= $flashMessage->render();
                } else {
@@ -935,8 +934,12 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                $multiple = '-';
                                $startExecutionElement = '&nbsp;';
                                // Restore the serialized task and pass it a reference to the scheduler object
-                               /** @var $task \TYPO3\CMS\Scheduler\Task */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
                                $task = unserialize($schedulerRecord['serialized_task_object']);
+                               $class = get_class($task);
+                               if ($class === '__PHP_Incomplete_Class' && preg_match('/^O:[0-9]+:"(?P<classname>.+?)"/', $schedulerRecord['serialized_task_object'], $matches) === 1) {
+                                       $class = $matches['classname'];
+                               }
                                // Assemble information about last execution
                                $context = '';
                                if (!empty($schedulerRecord['lastexecution_time'])) {
@@ -950,7 +953,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                }
                                if ($this->scheduler->isValidTaskObject($task)) {
                                        // The task object is valid
-                                       $name = htmlspecialchars($registeredClasses[$schedulerRecord['classname']]['title'] . ' (' . $registeredClasses[$schedulerRecord['classname']]['extension'] . ')');
+                                       $name = htmlspecialchars($registeredClasses[$class]['title'] . ' (' . $registeredClasses[$class]['extension'] . ')');
                                        $name .= '<br /> ';
                                        $additionalInformation = $task->getAdditionalInformation();
                                        if ($task instanceof \TYPO3\CMS\Scheduler\ProgressProviderInterface) {
@@ -999,7 +1002,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                                $multiple = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
                                        }
                                        // Define checkbox
-                                       $startExecutionElement = '<input type="checkbox" name="TYPO3\\CMS\\Scheduler\\Scheduler[execute][]" value="' . $schedulerRecord['uid'] . '" id="task_' . $schedulerRecord['uid'] . '" class="checkboxes" />';
+                                       $startExecutionElement = '<input type="checkbox" name="tx_scheduler[execute][]" value="' . $schedulerRecord['uid'] . '" id="task_' . $schedulerRecord['uid'] . '" class="checkboxes" />';
                                        // Show no action links (edit, delete) if task is running
                                        $actions = $editAction . $deleteAction;
                                        if ($isRunning) {
@@ -1015,7 +1018,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                        $failureOutput = '';
                                        if (!empty($schedulerRecord['lastexecution_failure'])) {
                                                // Try to get the stored exception object
-                                               /** @var $exception Exception */
+                                               /** @var $exception \Exception */
                                                $exception = unserialize($schedulerRecord['lastexecution_failure']);
                                                // If the exception could not be unserialized, issue a default error message
                                                if ($exception === FALSE || $exception instanceof \__PHP_Incomplete_Class) {
@@ -1041,8 +1044,8 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                } else {
                                        // The task object is not valid
                                        // Prepare to issue an error
-                                       /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
-                                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->getLL('msg.invalidTaskClass'), $schedulerRecord['classname']), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                                       /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
+                                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->getLL('msg.invalidTaskClass'), $class), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                                        $executionStatusOutput = $flashMessage->render();
                                        $tableLayout[$tr] = $rowWithSpan;
                                        $table[$tr][] = $startExecutionElement;
@@ -1057,7 +1060,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                        $content .= '<input type="submit" class="button" name="go" id="scheduler_executeselected" value="' . $GLOBALS['LANG']->getLL('label.executeSelected') . '" />';
                }
                if (!count($registeredClasses) > 0) {
-                       /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
+                       /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('msg.noTasksDefined'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
                        $content .= $flashMessage->render();
                }
@@ -1090,7 +1093,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                if (!empty($this->submittedData['uid'])) {
                        try {
                                $taskRecord = $this->scheduler->fetchTaskRecord($this->submittedData['uid']);
-                               /** @var \TYPO3\CMS\Scheduler\Task $task */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task */
                                $task = unserialize($taskRecord['serialized_task_object']);
                        } catch (\OutOfBoundsException $e) {
                                // If the task could not be fetched, issue an error message
@@ -1246,6 +1249,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                }
                // Validate additional input fields
                if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields'])) {
+                       /** @var $providerObject \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface */
                        $providerObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
                        if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                                // The validate method will return TRUE if all went well, but that must not
index 05da6f5..307e5ff 100644 (file)
@@ -99,16 +99,17 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                // Select all tasks with executions
                // NOTE: this cleanup is done for disabled tasks too,
                // to avoid leaving old executions lying around
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, classname, serialized_executions', 'tx_scheduler_task', 'serialized_executions <> \'\'');
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, serialized_executions, serialized_task_object', 'tx_scheduler_task', 'serialized_executions <> \'\'');
                $maxDuration = $this->extConf['maxLifetime'] * 60;
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $executions = array();
                        if ($serialized_executions = unserialize($row['serialized_executions'])) {
-                               $executions = array();
                                foreach ($serialized_executions as $task) {
                                        if ($tstamp - $task < $maxDuration) {
                                                $executions[] = $task;
                                        } else {
-                                               $logMessage = 'Removing logged execution, assuming that the process is dead. Execution of \'' . $row['classname'] . '\' (UID: ' . $row['uid'] . ') was started at ' . date('Y-m-d H:i:s', $task);
+                                               $task = unserialize($row['serialized_task_object']);
+                                               $logMessage = 'Removing logged execution, assuming that the process is dead. Execution of \'' . get_class($task) . '\' (UID: ' . $row['uid'] . ') was started at ' . date('Y-m-d H:i:s', $task);
                                                $this->log($logMessage);
                                        }
                                }
@@ -189,7 +190,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                if ($type !== 'manual' && $type !== 'cli-by-id') {
                        $type = 'cron';
                }
-               /** @var \TYPO3\CMS\Core\Registry $registry */
+               /** @var $registry \TYPO3\CMS\Core\Registry */
                $registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry');
                $runInformation = array('start' => $GLOBALS['EXEC_TIME'], 'end' => time(), 'type' => $type);
                $registry->set('tx_scheduler', 'lastRun', $runInformation);
@@ -234,7 +235,6 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                        $task->unsetScheduler();
                        $fields = array(
                                'nextexecution' => $executionTime,
-                               'classname' => get_class($task),
                                'disable' => $task->isDisabled(),
                                'serialized_task_object' => serialize($task)
                        );
@@ -417,8 +417,8 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                                $startTime = 'now+1minute';
                        }
                        $cliDispatchPath = PATH_site . 'typo3/cli_dispatch.phpsh';
+                       $currentLocale = setlocale(LC_CTYPE, 0);
                        if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
-                               $currentLocale = setlocale(LC_CTYPE, 0);
                                setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']);
                        }
                        $cmd = 'echo ' . escapeshellarg($cliDispatchPath) . ' scheduler | at ' . escapeshellarg($startTime) . ' 2>&1';
index 65eb535..8034e9a 100644 (file)
@@ -38,7 +38,7 @@ abstract class Task {
        /**
         * Reference to a scheduler object
         *
-        * @var         tx_scheduler
+        * @var \TYPO3\CMS\Scheduler\Scheduler
         */
        protected $scheduler;
 
@@ -66,7 +66,7 @@ abstract class Task {
        /**
         * This variable contains the time of next execution of the task
         *
-        * @var timestamp
+        * @var integer
         */
        protected $executionTime = 0;
 
@@ -359,7 +359,7 @@ abstract class Task {
         * Removes given execution from list
         *
         * @param integer $executionID Id of the execution to remove.
-        * @param Exception $failure An exception to signal a failed execution
+        * @param \Exception $failure An exception to signal a failed execution
         * @return      void
         */
        public function unmarkExecution($executionID, \Exception $failure = NULL) {
index b8e77a7..a13fdbc 100644 (file)
@@ -55,7 +55,7 @@ class CachingFrameworkGarbageCollectionAdditionalFieldProvider implements \TYPO3
                                $taskInfo['scheduler_cachingFrameworkGarbageCollection_selectedBackends'] = $task->selectedBackends;
                        }
                }
-               $fieldName = 'TYPO3\\CMS\\Scheduler\\Scheduler[scheduler_cachingFrameworkGarbageCollection_selectedBackends][]';
+               $fieldName = 'tx_scheduler[scheduler_cachingFrameworkGarbageCollection_selectedBackends][]';
                $fieldId = 'task_cachingFrameworkGarbageCollection_selectedBackends';
                $fieldOptions = $this->getCacheBackendOptions($taskInfo['scheduler_cachingFrameworkGarbageCollection_selectedBackends']);
                $fieldHtml = '<select name="' . $fieldName . '" id="' . $fieldId . '" class="wide" size="10" multiple="multiple">' . $fieldOptions . '</select>';
index 5fd957f..61f2c59 100644 (file)
@@ -59,7 +59,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu
         * @return void
         */
        protected function initDefaultNumberOfDays() {
-               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables'];
+               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'];
                foreach ($tableConfiguration as $tableName => $configuration) {
                        if (isset($configuration['expirePeriod'])) {
                                $this->defaultNumberOfDays[$tableName] = $configuration['expirePeriod'];
@@ -102,7 +102,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu
         * @return array Array containing all the information pertaining to the additional fields
         */
        protected function getTableAdditionalField(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) {
-               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables'];
+               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'];
                $options = array();
                // Add an empty option on top if an existing task is configured
                // with a table that can not be found in configuration anymore
@@ -217,7 +217,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu
         */
        public function validateTableAdditionalField(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) {
                $validData = FALSE;
-               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection']['options']['tables'];
+               $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'];
                if (!isset($submittedData['scheduler_tableGarbageCollection_table'])) {
                        $validData = TRUE;
                } elseif (array_key_exists($submittedData['scheduler_tableGarbageCollection_table'], $tableConfiguration)) {
index 5c3e928..d0b8fa5 100644 (file)
@@ -60,7 +60,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
         * @return boolean TRUE if task run was successful
         */
        public function execute() {
-               $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection']['options']['tables'];
+               $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'];
                $tableHandled = FALSE;
                foreach ($tableConfigurations as $tableName => $configuration) {
                        if ($this->allTables || $tableName === $this->table) {
@@ -69,7 +69,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
                        }
                }
                if (!$tableHandled) {
-                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399);
+                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399);
                }
                return TRUE;
        }
@@ -95,18 +95,18 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
                                $deleteTimestamp = strtotime('-' . $this->numberOfDays . 'days');
                        } else {
                                if (!isset($configuration['expirePeriod'])) {
-                                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection misconfiguration: No expirePeriod defined for table ' . $table, 1308355095);
+                                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: No expirePeriod defined for table ' . $table, 1308355095);
                                }
                                $deleteTimestamp = strtotime('-' . $configuration['expirePeriod'] . 'days');
                        }
                        $where = $configuration['dateField'] . ' < ' . $deleteTimestamp;
                } else {
-                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection misconfiguration: Either expireField or dateField must be defined for table ' . $table, 1308355268);
+                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: Either expireField or dateField must be defined for table ' . $table, 1308355268);
                }
                $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, $where);
                $error = $GLOBALS['TYPO3_DB']->sql_error();
                if ($error) {
-                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Scheduler_TableGarbageCollection failed for table ' . $this->table . ' with error: ' . $error, 1308255491);
+                       throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask failed for table ' . $this->table . ' with error: ' . $error, 1308255491);
                }
                return TRUE;
        }
index c006278..1808198 100644 (file)
@@ -26,7 +26,7 @@ if (!empty($extConf['showSampleTasks'])) {
        );
 }
 // Add caching framework garbage collection task
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask'] = array(
        'extension' => $_EXTKEY,
        'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.name',
        'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.description',
index dd5d321..bbe3a63 100755 (executable)
@@ -5,7 +5,6 @@ CREATE TABLE tx_scheduler_task (
        uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
        crdate int(11) unsigned DEFAULT '0' NOT NULL,
        disable tinyint(4) unsigned DEFAULT '0' NOT NULL,
-       classname varchar(255) DEFAULT '' NOT NULL,
        nextexecution int(11) unsigned DEFAULT '0' NOT NULL,
        lastexecution_time int(11) unsigned DEFAULT '0' NOT NULL,
        lastexecution_failure text NOT NULL,