[TASK] Add "Abstract" prefix to abstract task class
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 8 Nov 2012 21:34:05 +0000 (22:34 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 8 Nov 2012 21:49:02 +0000 (22:49 +0100)
All abstract classes should be start with an Abstract
prefix in the class name.

Adjust the abstract task class to this naming convention.

Resolves: #42803
Releases: 6.0

Change-Id: Ibef1d71f1d3a6aa3683331464b33118b88b1ec01
Reviewed-on: http://review.typo3.org/16329
Reviewed-by: Steffen Ritter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
23 files changed:
typo3/sysext/extensionmanager/Classes/Task/UpdateExtensionListTask.php
typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php
typo3/sysext/reports/Classes/Task/SystemStatusUpdateTaskNotificationEmailField.php
typo3/sysext/saltedpasswords/Classes/Task/BulkUpdateFieldProvider.php
typo3/sysext/saltedpasswords/Classes/Task/BulkUpdateTask.php
typo3/sysext/scheduler/Classes/AdditionalFieldProviderInterface.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Classes/Example/SleepTask.php
typo3/sysext/scheduler/Classes/Example/SleepTaskAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Example/TestTask.php
typo3/sysext/scheduler/Classes/Example/TestTaskAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Scheduler.php
typo3/sysext/scheduler/Classes/Task.php [deleted file]
typo3/sysext/scheduler/Classes/Task/AbstractTask.php [new file with mode: 0644]
typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionTask.php
typo3/sysext/scheduler/Classes/Task/FileIndexingTask.php
typo3/sysext/scheduler/Classes/Task/RecyclerGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/RecyclerGarbageCollectionTask.php
typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php
typo3/sysext/scheduler/Migrations/Code/ClassAliasMap.php
typo3/sysext/scheduler/cli/scheduler_cli_dispatch.php

index b056efe..2614220 100644 (file)
@@ -29,7 +29,7 @@ namespace TYPO3\CMS\Extensionmanager\Task;
  *
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task {
+class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * Public method, called by scheduler.
index a067d7e..e74b334 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Reports\Task;
  * @package TYPO3
  * @subpackage reports
  */
-class SystemStatusUpdateTask extends \TYPO3\CMS\Scheduler\Task {
+class SystemStatusUpdateTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * Email address to send email notification to in case we find problems with
index adfa065..3d80c55 100644 (file)
@@ -51,7 +51,7 @@ class SystemStatusUpdateTaskNotificationEmailField implements \TYPO3\CMS\Schedul
         * Gets additional fields to render in the form to add/edit a task
         *
         * @param array $taskInfo Values of the fields from the add/edit task form
-        * @param \TYPO3\CMS\Scheduler\Task $task The task object being eddited. Null when adding a task!
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task object being eddited. Null when adding a task!
         * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
         * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
         */
@@ -96,10 +96,10 @@ class SystemStatusUpdateTaskNotificationEmailField implements \TYPO3\CMS\Schedul
         * Takes care of saving the additional fields' values in the task's object
         *
         * @param array $submittedData An array containing the data submitted by the add/edit task form
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the scheduler backend module
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                if (!$task instanceof \TYPO3\CMS\Reports\Task\SystemStatusUpdateTask) {
                        throw new \InvalidArgumentException('Expected a task of type TYPO3\\CMS\\Reports\\Task\\SystemStatusUpdateTask, but got ' . get_class($task), 1295012802);
                }
index 14cbe8f..972be9a 100644 (file)
@@ -123,7 +123,7 @@ class BulkUpdateFieldProvider implements \TYPO3\CMS\Scheduler\AdditionalFieldPro
         * @param tx_scheduler_Task|tx_saltedpasswords_Tasks_BulkUpdate $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                if (isset($submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf']) && $submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'] === 'IsChecked') {
                        $task->setCanDeactivateSelf(TRUE);
                } else {
index e41689a..5d0221b 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Saltedpasswords\Task;
  * @package TYPO3
  * @subpackage saltedpasswords
  */
-class BulkUpdateTask extends \TYPO3\CMS\Scheduler\Task {
+class BulkUpdateTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * @var boolean Whether or not the task is allowed to deactivate itself after processing all existing user records.
index 0830383..e4c2b0e 100644 (file)
@@ -36,7 +36,7 @@ interface AdditionalFieldProviderInterface
         * Gets additional fields to render in the form to add/edit a task
         *
         * @param array $taskInfo Values of the fields from the add/edit task form
-        * @param \TYPO3\CMS\Scheduler\Task $task The task object being edited. Null when adding a task!
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task object being edited. Null when adding a task!
         * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
         * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
         */
@@ -55,10 +55,10 @@ interface AdditionalFieldProviderInterface
         * Takes care of saving the additional fields' values in the task's object
         *
         * @param array $submittedData An array containing the data submitted by the add/edit task form
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the scheduler backend module
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task);
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task);
 
 }
 
index c925693..3cbe29d 100644 (file)
@@ -547,7 +547,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                        throw new \LogicException('Runnings tasks cannot not be edited', 1251232849);
                                }
                                // Get the task object
-                               /** @var $task \TYPO3\CMS\Scheduler\Task */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask */
                                $task = unserialize($taskRecord['serialized_task_object']);
                                // Set some task information
                                $taskInfo['disable'] = $taskRecord['disable'];
@@ -935,7 +935,7 @@ 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|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\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) {
@@ -1094,7 +1094,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                if (!empty($this->submittedData['uid'])) {
                        try {
                                $taskRecord = $this->scheduler->fetchTaskRecord($this->submittedData['uid']);
-                               /** @var $task \TYPO3\CMS\Scheduler\Task */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask */
                                $task = unserialize($taskRecord['serialized_task_object']);
                        } catch (\OutOfBoundsException $e) {
                                // If the task could not be fetched, issue an error message
index d822f79..9d85147 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Scheduler\Example;
  * @package            TYPO3
  * @subpackage         tx_scheduler
  */
-class SleepTask extends \TYPO3\CMS\Scheduler\Task {
+class SleepTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * Number of seconds the task should be sleeping for
index 79ac74c..a618e28 100644 (file)
@@ -92,10 +92,10 @@ class SleepTaskAdditionalFieldProvider implements \TYPO3\CMS\Scheduler\Additiona
         * if the task class matches
         *
         * @param array $submittedData Array containing the data submitted by the user
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the current task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $task->sleepTime = $submittedData['sleepTime'];
        }
 
index 07c1d33..d7e80c0 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Example;
  * @package            TYPO3
  * @subpackage         tx_scheduler
  */
-class TestTask extends \TYPO3\CMS\Scheduler\Task {
+class TestTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * An email address to be used during the process
index 28028e3..90addee 100644 (file)
@@ -92,10 +92,10 @@ class TestTaskAdditionalFieldProvider implements \TYPO3\CMS\Scheduler\Additional
         * if the task class matches
         *
         * @param array $submittedData Array containing the data submitted by the user
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the current task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $task->email = $submittedData['email'];
        }
 
index c0b7c78..c629cd7 100644 (file)
@@ -62,10 +62,10 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Adds a task to the pool
         *
-        * @param \TYPO3\CMS\Scheduler\Task $task The object representing the task to add
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The object representing the task to add
         * @return boolean TRUE if the task was successfully added, FALSE otherwise
         */
-       public function addTask(\TYPO3\CMS\Scheduler\Task $task) {
+       public function addTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $taskUid = $task->getTaskUid();
                if (empty($taskUid)) {
                        $fields = array(
@@ -129,10 +129,10 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
         * This method executes the given task and properly marks and records that execution
         * It is expected to return FALSE if the task was barred from running or if it was not saved properly
         *
-        * @param \TYPO3\CMS\Scheduler\Task $task The task to execute
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task to execute
         * @return boolean Whether the task was saved successfully to the database or not
         */
-       public function executeTask(\TYPO3\CMS\Scheduler\Task $task) {
+       public function executeTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                // Trigger the saving of the task, as this will calculate its next execution time
                // This should be calculated all the time, even if the execution is skipped
                // (in case it is skipped, this pushes back execution to the next possible date)
@@ -199,10 +199,10 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
         * Removes a task completely from the system.
         * TODO: find a way to actually kill the existing jobs
         *
-        * @param \TYPO3\CMS\Scheduler\Task $task The object representing the task to delete
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The object representing the task to delete
         * @return boolean TRUE if task was successfully deleted, FALSE otherwise
         */
-       public function removeTask(\TYPO3\CMS\Scheduler\Task $task) {
+       public function removeTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $taskUid = $task->getTaskUid();
                if (!empty($taskUid)) {
                        $result = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_scheduler_task', 'uid = ' . $taskUid);
@@ -218,10 +218,10 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Updates a task in the pool
         *
-        * @param \TYPO3\CMS\Scheduler\Task $task Scheduler task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Scheduler task object
         * @return boolean False if submitted task was not of proper class
         */
-       public function saveTask(\TYPO3\CMS\Scheduler\Task $task) {
+       public function saveTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $taskUid = $task->getTaskUid();
                if (!empty($taskUid)) {
                        try {
@@ -253,7 +253,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
         * If there are no due tasks the method throws an exception.
         *
         * @param integer $uid Primary key of a task
-        * @return \TYPO3\CMS\Scheduler\Task The fetched task object
+        * @return \TYPO3\CMS\Scheduler\Task\AbstractTask The fetched task object
         */
        public function fetchTask($uid = 0) {
                // Define where clause
@@ -275,7 +275,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                        throw new \OutOfBoundsException('No task', 1247827244);
                } else {
                        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-                       /** @var $task \TYPO3\CMS\Scheduler\Task */
+                       /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask */
                        $task = unserialize($row['serialized_task_object']);
                        if ($this->isValidTaskObject($task)) {
                                // The task is valid, return it
@@ -361,7 +361,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
         * @return boolean TRUE if object is a task, FALSE otherwise
         */
        public function isValidTaskObject($task) {
-               return $task instanceof \TYPO3\CMS\Scheduler\Task;
+               return $task instanceof \TYPO3\CMS\Scheduler\Task\AbstractTask;
        }
 
        /**
@@ -403,7 +403,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                $tasks = $this->fetchTasksWithCondition('');
                $nextExecution = FALSE;
                foreach ($tasks as $task) {
-                       /** @var $task \TYPO3\CMS\Scheduler\Task */
+                       /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask */
                        $tempNextExecution = $task->getNextDueExecution();
                        if ($nextExecution === FALSE || $tempNextExecution < $nextExecution) {
                                $nextExecution = $tempNextExecution;
diff --git a/typo3/sysext/scheduler/Classes/Task.php b/typo3/sysext/scheduler/Classes/Task.php
deleted file mode 100644 (file)
index 8034e9a..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-<?php
-namespace TYPO3\CMS\Scheduler;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 Christian Jul Jensen (julle@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!
- ***************************************************************/
-/**
- * This is the base class for all Scheduler tasks
- * It's an abstract class, not designed to be instantiated directly
- * All Scheduler tasks should inherit from this class
- *
- * @author     Fran├žois Suter <francois@typo3.org>
- * @author     Christian Jul Jensen <julle@typo3.org>
- * @package            TYPO3
- * @subpackage         tx_scheduler
- */
-abstract class Task {
-
-       /**
-        * Reference to a scheduler object
-        *
-        * @var \TYPO3\CMS\Scheduler\Scheduler
-        */
-       protected $scheduler;
-
-       /**
-        * The unique id of the task used to identify it in the database
-        *
-        * @var int
-        */
-       protected $taskUid;
-
-       /**
-        * Disable flag, TRUE if task is disabled, FALSE otherwise
-        *
-        * @var         boolean
-        */
-       protected $disabled = FALSE;
-
-       /**
-        * The execution object related to the task
-        *
-        * @var \TYPO3\CMS\Scheduler\Execution
-        */
-       protected $execution;
-
-       /**
-        * This variable contains the time of next execution of the task
-        *
-        * @var integer
-        */
-       protected $executionTime = 0;
-
-       /**
-        * Constructor
-        */
-       public function __construct() {
-               $this->setScheduler();
-               $this->execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
-       }
-
-       /**
-        * This is the main method that is called when a task is executed
-        * It MUST be implemented by all classes inheriting from this one
-        * Note that there is no error handling, errors and failures are expected
-        * to be handled and logged by the client implementations.
-        * Should return TRUE on successful execution, FALSE on error.
-        *
-        * @return boolean Returns TRUE on successful execution, FALSE on error
-        */
-       abstract public function execute();
-
-       /**
-        * This method is designed to return some additional information about the task,
-        * that may help to set it apart from other tasks from the same class
-        * This additional information is used - for example - in the Scheduler's BE module
-        * This method should be implemented in most task classes
-        *
-        * @return string Information to display
-        */
-       public function getAdditionalInformation() {
-               return '';
-       }
-
-       /**
-        * This method is used to set the unique id of the task
-        *
-        * @param integer $id Primary key (from the database record) of the scheduled task
-        * @return void
-        */
-       public function setTaskUid($id) {
-               $this->taskUid = intval($id);
-       }
-
-       /**
-        * This method returns the unique id of the task
-        *
-        * @return integer The id of the task
-        */
-       public function getTaskUid() {
-               return $this->taskUid;
-       }
-
-       /**
-        * This method returns the title of the scheduler task
-        *
-        * @return string
-        */
-       public function getTaskTitle() {
-               return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['title']);
-       }
-
-       /**
-        * This method returns the description of the scheduler task
-        *
-        * @return string
-        */
-       public function getTaskDescription() {
-               return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['description']);
-       }
-
-       /**
-        * This method returns the class name of the scheduler task
-        *
-        * @return string
-        */
-       public function getTaskClassName() {
-               return get_class($this);
-       }
-
-       /**
-        * This method returns the disable status of the task
-        *
-        * @return boolean TRUE if task is disabled, FALSE otherwise
-        */
-       public function isDisabled() {
-               return $this->disabled;
-       }
-
-       /**
-        * This method is used to set the disable status of the task
-        *
-        * @param boolean $flag TRUE if task should be disabled, FALSE otherwise
-        * @return void
-        */
-       public function setDisabled($flag) {
-               if ($flag) {
-                       $this->disabled = TRUE;
-               } else {
-                       $this->disabled = FALSE;
-               }
-       }
-
-       /**
-        * This method is used to set the timestamp corresponding to the next execution time of the task
-        *
-        * @param integer $timestamp Timestamp of next execution
-        * @return void
-        */
-       public function setExecutionTime($timestamp) {
-               $this->executionTime = intval($timestamp);
-       }
-
-       /**
-        * This method returns the timestamp corresponding to the next execution time of the task
-        *
-        * @return integer Timestamp of next execution
-        */
-       public function getExecutionTime() {
-               return $this->executionTime;
-       }
-
-       /**
-        * Sets the internal reference to the singleton instance of the Scheduler
-        *
-        * @return void
-        */
-       public function setScheduler() {
-               $this->scheduler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Scheduler');
-       }
-
-       /**
-        * Unsets the internal reference to the singleton instance of the Scheduler
-        * This is done before a task is serialized, so that the scheduler instance
-        * is not saved to the database too
-        *
-        * @return void
-        */
-       public function unsetScheduler() {
-               unset($this->scheduler);
-       }
-
-       /**
-        * Registers a single execution of the task
-        *
-        * @param integer $timestamp Timestamp of the next execution
-        */
-       public function registerSingleExecution($timestamp) {
-               /** @var $execution \TYPO3\CMS\Scheduler\Execution */
-               $execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
-               $execution->setStart($timestamp);
-               $execution->setInterval(0);
-               $execution->setEnd($timestamp);
-               $execution->setCronCmd('');
-               $execution->setMultiple(0);
-               $execution->setIsNewSingleExecution(TRUE);
-               // Replace existing execution object
-               $this->execution = $execution;
-       }
-
-       /**
-        * Registers a recurring execution of the task
-        *
-        * @param integer $start The first date/time where this execution should occur (timestamp)
-        * @param string $interval Execution interval in seconds
-        * @param integer $end The last date/time where this execution should occur (timestamp)
-        * @param boolean $multiple Set to FALSE if multiple executions of this task are not permitted in parallel
-        * @param string $cron_cmd Used like in crontab (minute hour day month weekday)
-        * @return void
-        */
-       public function registerRecurringExecution($start, $interval, $end = 0, $multiple = FALSE, $cron_cmd = '') {
-               /** @var $execution \TYPO3\CMS\Scheduler\Execution */
-               $execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
-               // Set general values
-               $execution->setStart($start);
-               $execution->setEnd($end);
-               $execution->setMultiple($multiple);
-               if (empty($cron_cmd)) {
-                       // Use interval
-                       $execution->setInterval($interval);
-                       $execution->setCronCmd('');
-               } else {
-                       // Use cron syntax
-                       $execution->setInterval(0);
-                       $execution->setCronCmd($cron_cmd);
-               }
-               // Replace existing execution object
-               $this->execution = $execution;
-       }
-
-       /**
-        * Sets the internal execution object
-        *
-        * @param \TYPO3\CMS\Scheduler\Execution $execution The execution to add
-        */
-       public function setExecution(\TYPO3\CMS\Scheduler\Execution $execution) {
-               $this->execution = $execution;
-       }
-
-       /**
-        * Returns the execution object
-        *
-        * @return \TYPO3\CMS\Scheduler\Execution The internal execution object
-        */
-       public function getExecution() {
-               return $this->execution;
-       }
-
-       /**
-        * Returns the timestamp for next due execution of the task
-        *
-        * @return integer Date and time of the next execution as a timestamp
-        */
-       public function getNextDueExecution() {
-               // NOTE: this call may throw an exception, but we let it bubble up
-               return $this->execution->getNextExecution();
-       }
-
-       /**
-        * Returns TRUE if several runs of the task are allowed concurrently
-        *
-        * @return boolean TRUE if concurrent executions are allowed, FALSE otherwise
-        */
-       public function areMultipleExecutionsAllowed() {
-               return $this->execution->getMultiple();
-       }
-
-       /**
-        * Returns TRUE if an instance of the task is already running
-        *
-        * @return boolean TRUE if an instance is already running, FALSE otherwise
-        */
-       public function isExecutionRunning() {
-               $isRunning = FALSE;
-               $queryArr = array(
-                       'SELECT' => 'serialized_executions',
-                       'FROM' => 'tx_scheduler_task',
-                       'WHERE' => 'uid = ' . intval($this->taskUid),
-                       'LIMIT' => 1
-               );
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if (strlen($row['serialized_executions']) > 0) {
-                               $isRunning = TRUE;
-                       }
-               }
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
-               return $isRunning;
-       }
-
-       /**
-        * This method adds current execution to the execution list
-        * It also logs the execution time and mode
-        *
-        * @return integer Execution id
-        */
-       public function markExecution() {
-               $queryArr = array(
-                       'SELECT' => 'serialized_executions',
-                       'FROM' => 'tx_scheduler_task',
-                       'WHERE' => 'uid = ' . intval($this->taskUid),
-                       'LIMIT' => 1
-               );
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
-               $runningExecutions = array();
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if (strlen($row['serialized_executions']) > 0) {
-                               $runningExecutions = unserialize($row['serialized_executions']);
-                       }
-               }
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
-               // Count the number of existing executions and use that number as a key
-               // (we need to know that number, because it is returned at the end of the method)
-               $numExecutions = count($runningExecutions);
-               $runningExecutions[$numExecutions] = time();
-               // Define the context in which the script is running
-               $context = 'BE';
-               if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) {
-                       $context = 'CLI';
-               }
-               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
-                       'serialized_executions' => serialize($runningExecutions),
-                       'lastexecution_time' => time(),
-                       'lastexecution_context' => $context
-               ));
-               return $numExecutions;
-       }
-
-       /**
-        * Removes given execution from list
-        *
-        * @param integer $executionID Id of the execution to remove.
-        * @param \Exception $failure An exception to signal a failed execution
-        * @return      void
-        */
-       public function unmarkExecution($executionID, \Exception $failure = NULL) {
-               // Get the executions for the task
-               $queryArr = array(
-                       'SELECT' => 'serialized_executions',
-                       'FROM' => 'tx_scheduler_task',
-                       'WHERE' => 'uid = ' . intval($this->taskUid),
-                       'LIMIT' => 1
-               );
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if (strlen($row['serialized_executions']) > 0) {
-                               $runningExecutions = unserialize($row['serialized_executions']);
-                               // Remove the selected execution
-                               unset($runningExecutions[$executionID]);
-                               if (count($runningExecutions) > 0) {
-                                       // Re-serialize the updated executions list (if necessary)
-                                       $runningExecutionsSerialized = serialize($runningExecutions);
-                               } else {
-                                       $runningExecutionsSerialized = '';
-                               }
-                               if ($failure instanceof \Exception) {
-                                       // Log failed execution
-                                       $logMessage = 'Task failed to execute successfully. Class: ' . get_class($this) . ', UID: ' . $this->taskUid . '. ' . $failure->getMessage();
-                                       $this->scheduler->log($logMessage, 1, $failure->getCode());
-                                       $failure = serialize($failure);
-                               } else {
-                                       $failure = '';
-                               }
-                               // Save the updated executions list
-                               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
-                                       'serialized_executions' => $runningExecutionsSerialized,
-                                       'lastexecution_failure' => $failure
-                               ));
-                       }
-               }
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
-       }
-
-       /**
-        * Clears all marked executions
-        *
-        * @return boolean TRUE if the clearing succeeded, FALSE otherwise
-        */
-       public function unmarkAllExecutions() {
-               // Set the serialized executions field to empty
-               $result = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
-                       'serialized_executions' => ''
-               ));
-               return $result;
-       }
-
-       /**
-        * Saves the details of the task to the database.
-        *
-        * @return bool
-        */
-       public function save() {
-               return $this->scheduler->saveTask($this);
-       }
-
-       /**
-        * Stops the task, by replacing the execution object by an empty one
-        * NOTE: the task still needs to be saved after that
-        *
-        * @return      void
-        */
-       public function stop() {
-               $this->execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
-       }
-
-       /**
-        * Removes the task totally from the system.
-        *
-        * @return      void
-        */
-       public function remove() {
-               $this->scheduler->removeTask($this);
-       }
-
-}
-
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/scheduler/Classes/Task/AbstractTask.php b/typo3/sysext/scheduler/Classes/Task/AbstractTask.php
new file mode 100644 (file)
index 0000000..886f7ba
--- /dev/null
@@ -0,0 +1,447 @@
+<?php
+namespace TYPO3\CMS\Scheduler\Task;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 Christian Jul Jensen (julle@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!
+ ***************************************************************/
+/**
+ * This is the base class for all Scheduler tasks
+ * It's an abstract class, not designed to be instantiated directly
+ * All Scheduler tasks should inherit from this class
+ *
+ * @author     Fran├žois Suter <francois@typo3.org>
+ * @author     Christian Jul Jensen <julle@typo3.org>
+ * @package            TYPO3
+ * @subpackage         tx_scheduler
+ */
+abstract class AbstractTask {
+
+       /**
+        * Reference to a scheduler object
+        *
+        * @var \TYPO3\CMS\Scheduler\Scheduler
+        */
+       protected $scheduler;
+
+       /**
+        * The unique id of the task used to identify it in the database
+        *
+        * @var int
+        */
+       protected $taskUid;
+
+       /**
+        * Disable flag, TRUE if task is disabled, FALSE otherwise
+        *
+        * @var         boolean
+        */
+       protected $disabled = FALSE;
+
+       /**
+        * The execution object related to the task
+        *
+        * @var \TYPO3\CMS\Scheduler\Execution
+        */
+       protected $execution;
+
+       /**
+        * This variable contains the time of next execution of the task
+        *
+        * @var integer
+        */
+       protected $executionTime = 0;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->setScheduler();
+               $this->execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
+       }
+
+       /**
+        * This is the main method that is called when a task is executed
+        * It MUST be implemented by all classes inheriting from this one
+        * Note that there is no error handling, errors and failures are expected
+        * to be handled and logged by the client implementations.
+        * Should return TRUE on successful execution, FALSE on error.
+        *
+        * @return boolean Returns TRUE on successful execution, FALSE on error
+        */
+       abstract public function execute();
+
+       /**
+        * This method is designed to return some additional information about the task,
+        * that may help to set it apart from other tasks from the same class
+        * This additional information is used - for example - in the Scheduler's BE module
+        * This method should be implemented in most task classes
+        *
+        * @return string Information to display
+        */
+       public function getAdditionalInformation() {
+               return '';
+       }
+
+       /**
+        * This method is used to set the unique id of the task
+        *
+        * @param integer $id Primary key (from the database record) of the scheduled task
+        * @return void
+        */
+       public function setTaskUid($id) {
+               $this->taskUid = intval($id);
+       }
+
+       /**
+        * This method returns the unique id of the task
+        *
+        * @return integer The id of the task
+        */
+       public function getTaskUid() {
+               return $this->taskUid;
+       }
+
+       /**
+        * This method returns the title of the scheduler task
+        *
+        * @return string
+        */
+       public function getTaskTitle() {
+               return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['title']);
+       }
+
+       /**
+        * This method returns the description of the scheduler task
+        *
+        * @return string
+        */
+       public function getTaskDescription() {
+               return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['description']);
+       }
+
+       /**
+        * This method returns the class name of the scheduler task
+        *
+        * @return string
+        */
+       public function getTaskClassName() {
+               return get_class($this);
+       }
+
+       /**
+        * This method returns the disable status of the task
+        *
+        * @return boolean TRUE if task is disabled, FALSE otherwise
+        */
+       public function isDisabled() {
+               return $this->disabled;
+       }
+
+       /**
+        * This method is used to set the disable status of the task
+        *
+        * @param boolean $flag TRUE if task should be disabled, FALSE otherwise
+        * @return void
+        */
+       public function setDisabled($flag) {
+               if ($flag) {
+                       $this->disabled = TRUE;
+               } else {
+                       $this->disabled = FALSE;
+               }
+       }
+
+       /**
+        * This method is used to set the timestamp corresponding to the next execution time of the task
+        *
+        * @param integer $timestamp Timestamp of next execution
+        * @return void
+        */
+       public function setExecutionTime($timestamp) {
+               $this->executionTime = intval($timestamp);
+       }
+
+       /**
+        * This method returns the timestamp corresponding to the next execution time of the task
+        *
+        * @return integer Timestamp of next execution
+        */
+       public function getExecutionTime() {
+               return $this->executionTime;
+       }
+
+       /**
+        * Sets the internal reference to the singleton instance of the Scheduler
+        *
+        * @return void
+        */
+       public function setScheduler() {
+               $this->scheduler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Scheduler');
+       }
+
+       /**
+        * Unsets the internal reference to the singleton instance of the Scheduler
+        * This is done before a task is serialized, so that the scheduler instance
+        * is not saved to the database too
+        *
+        * @return void
+        */
+       public function unsetScheduler() {
+               unset($this->scheduler);
+       }
+
+       /**
+        * Registers a single execution of the task
+        *
+        * @param integer $timestamp Timestamp of the next execution
+        */
+       public function registerSingleExecution($timestamp) {
+               /** @var $execution \TYPO3\CMS\Scheduler\Execution */
+               $execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
+               $execution->setStart($timestamp);
+               $execution->setInterval(0);
+               $execution->setEnd($timestamp);
+               $execution->setCronCmd('');
+               $execution->setMultiple(0);
+               $execution->setIsNewSingleExecution(TRUE);
+               // Replace existing execution object
+               $this->execution = $execution;
+       }
+
+       /**
+        * Registers a recurring execution of the task
+        *
+        * @param integer $start The first date/time where this execution should occur (timestamp)
+        * @param string $interval Execution interval in seconds
+        * @param integer $end The last date/time where this execution should occur (timestamp)
+        * @param boolean $multiple Set to FALSE if multiple executions of this task are not permitted in parallel
+        * @param string $cron_cmd Used like in crontab (minute hour day month weekday)
+        * @return void
+        */
+       public function registerRecurringExecution($start, $interval, $end = 0, $multiple = FALSE, $cron_cmd = '') {
+               /** @var $execution \TYPO3\CMS\Scheduler\Execution */
+               $execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
+               // Set general values
+               $execution->setStart($start);
+               $execution->setEnd($end);
+               $execution->setMultiple($multiple);
+               if (empty($cron_cmd)) {
+                       // Use interval
+                       $execution->setInterval($interval);
+                       $execution->setCronCmd('');
+               } else {
+                       // Use cron syntax
+                       $execution->setInterval(0);
+                       $execution->setCronCmd($cron_cmd);
+               }
+               // Replace existing execution object
+               $this->execution = $execution;
+       }
+
+       /**
+        * Sets the internal execution object
+        *
+        * @param \TYPO3\CMS\Scheduler\Execution $execution The execution to add
+        */
+       public function setExecution(\TYPO3\CMS\Scheduler\Execution $execution) {
+               $this->execution = $execution;
+       }
+
+       /**
+        * Returns the execution object
+        *
+        * @return \TYPO3\CMS\Scheduler\Execution The internal execution object
+        */
+       public function getExecution() {
+               return $this->execution;
+       }
+
+       /**
+        * Returns the timestamp for next due execution of the task
+        *
+        * @return integer Date and time of the next execution as a timestamp
+        */
+       public function getNextDueExecution() {
+               // NOTE: this call may throw an exception, but we let it bubble up
+               return $this->execution->getNextExecution();
+       }
+
+       /**
+        * Returns TRUE if several runs of the task are allowed concurrently
+        *
+        * @return boolean TRUE if concurrent executions are allowed, FALSE otherwise
+        */
+       public function areMultipleExecutionsAllowed() {
+               return $this->execution->getMultiple();
+       }
+
+       /**
+        * Returns TRUE if an instance of the task is already running
+        *
+        * @return boolean TRUE if an instance is already running, FALSE otherwise
+        */
+       public function isExecutionRunning() {
+               $isRunning = FALSE;
+               $queryArr = array(
+                       'SELECT' => 'serialized_executions',
+                       'FROM' => 'tx_scheduler_task',
+                       'WHERE' => 'uid = ' . intval($this->taskUid),
+                       'LIMIT' => 1
+               );
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
+               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       if (strlen($row['serialized_executions']) > 0) {
+                               $isRunning = TRUE;
+                       }
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               return $isRunning;
+       }
+
+       /**
+        * This method adds current execution to the execution list
+        * It also logs the execution time and mode
+        *
+        * @return integer Execution id
+        */
+       public function markExecution() {
+               $queryArr = array(
+                       'SELECT' => 'serialized_executions',
+                       'FROM' => 'tx_scheduler_task',
+                       'WHERE' => 'uid = ' . intval($this->taskUid),
+                       'LIMIT' => 1
+               );
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
+               $runningExecutions = array();
+               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       if (strlen($row['serialized_executions']) > 0) {
+                               $runningExecutions = unserialize($row['serialized_executions']);
+                       }
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               // Count the number of existing executions and use that number as a key
+               // (we need to know that number, because it is returned at the end of the method)
+               $numExecutions = count($runningExecutions);
+               $runningExecutions[$numExecutions] = time();
+               // Define the context in which the script is running
+               $context = 'BE';
+               if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) {
+                       $context = 'CLI';
+               }
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
+                       'serialized_executions' => serialize($runningExecutions),
+                       'lastexecution_time' => time(),
+                       'lastexecution_context' => $context
+               ));
+               return $numExecutions;
+       }
+
+       /**
+        * Removes given execution from list
+        *
+        * @param integer $executionID Id of the execution to remove.
+        * @param \Exception $failure An exception to signal a failed execution
+        * @return      void
+        */
+       public function unmarkExecution($executionID, \Exception $failure = NULL) {
+               // Get the executions for the task
+               $queryArr = array(
+                       'SELECT' => 'serialized_executions',
+                       'FROM' => 'tx_scheduler_task',
+                       'WHERE' => 'uid = ' . intval($this->taskUid),
+                       'LIMIT' => 1
+               );
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArr);
+               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       if (strlen($row['serialized_executions']) > 0) {
+                               $runningExecutions = unserialize($row['serialized_executions']);
+                               // Remove the selected execution
+                               unset($runningExecutions[$executionID]);
+                               if (count($runningExecutions) > 0) {
+                                       // Re-serialize the updated executions list (if necessary)
+                                       $runningExecutionsSerialized = serialize($runningExecutions);
+                               } else {
+                                       $runningExecutionsSerialized = '';
+                               }
+                               if ($failure instanceof \Exception) {
+                                       // Log failed execution
+                                       $logMessage = 'Task failed to execute successfully. Class: ' . get_class($this) . ', UID: ' . $this->taskUid . '. ' . $failure->getMessage();
+                                       $this->scheduler->log($logMessage, 1, $failure->getCode());
+                                       $failure = serialize($failure);
+                               } else {
+                                       $failure = '';
+                               }
+                               // Save the updated executions list
+                               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
+                                       'serialized_executions' => $runningExecutionsSerialized,
+                                       'lastexecution_failure' => $failure
+                               ));
+                       }
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+       }
+
+       /**
+        * Clears all marked executions
+        *
+        * @return boolean TRUE if the clearing succeeded, FALSE otherwise
+        */
+       public function unmarkAllExecutions() {
+               // Set the serialized executions field to empty
+               $result = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . intval($this->taskUid), array(
+                       'serialized_executions' => ''
+               ));
+               return $result;
+       }
+
+       /**
+        * Saves the details of the task to the database.
+        *
+        * @return bool
+        */
+       public function save() {
+               return $this->scheduler->saveTask($this);
+       }
+
+       /**
+        * Stops the task, by replacing the execution object by an empty one
+        * NOTE: the task still needs to be saved after that
+        *
+        * @return      void
+        */
+       public function stop() {
+               $this->execution = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Execution');
+       }
+
+       /**
+        * Removes the task totally from the system.
+        *
+        * @return      void
+        */
+       public function remove() {
+               $this->scheduler->removeTask($this);
+       }
+
+}
+
+
+?>
\ No newline at end of file
index a13fdbc..b0a78f0 100644 (file)
@@ -95,10 +95,10 @@ class CachingFrameworkGarbageCollectionAdditionalFieldProvider implements \TYPO3
         * Save selected backends in task object
         *
         * @param array $submittedData Contains data submitted by the user
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the current task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $task->selectedBackends = $submittedData['scheduler_cachingFrameworkGarbageCollection_selectedBackends'];
        }
 
index 2ab281c..0a24217 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Scheduler\Task;
  * @package TYPO3
  * @subpackage scheduler
  */
-class CachingFrameworkGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
+class CachingFrameworkGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * Backend types that should be cleaned up,
index a4fb4f6..cba1c4e 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Task;
  * @package TYPO3
  * @subpackage media
  */
-class FileIndexingTask extends \TYPO3\CMS\Scheduler\Task {
+class FileIndexingTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * @var string
index 89c9927..1409e40 100644 (file)
@@ -94,10 +94,10 @@ class RecyclerGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Sch
         * Saves given integer value in task object
         *
         * @param array $submittedData Contains data submitted by the user
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the current task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $task->numberOfDays = intval($submittedData['scheduler_recyclerGarbageCollection_numberOfDays']);
        }
 
index 43381e8..74248fa 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Scheduler\Task;
  * @package TYPO3
  * @subpackage scheduler
  */
-class RecyclerGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
+class RecyclerGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * Elapsed period since last modification before a file will
index 61f2c59..eb30052 100644 (file)
@@ -250,10 +250,10 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu
         * Save additional field in task
         *
         * @param array $submittedData Contains data submitted by the user
-        * @param \TYPO3\CMS\Scheduler\Task $task Reference to the current task object
+        * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
         * @return void
         */
-       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task) {
+       public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
                $task->allTables = $submittedData['scheduler_tableGarbageCollection_allTables'] === 'on' ? TRUE : FALSE;
                $task->table = $submittedData['scheduler_tableGarbageCollection_table'];
                $task->numberOfDays = intval($submittedData['scheduler_tableGarbageCollection_numberOfDays']);
index d0b8fa5..2f3c931 100644 (file)
@@ -36,7 +36,7 @@ namespace TYPO3\CMS\Scheduler\Task;
  * @package TYPO3
  * @subpackage scheduler
  */
-class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task {
+class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
 
        /**
         * @var boolean True if all tables should be cleaned up
index 90ebc9f..90cd5d9 100644 (file)
@@ -10,7 +10,7 @@ return array(
        'tx_scheduler_FailedExecutionException' => 'TYPO3\\CMS\\Scheduler\\FailedExecutionException',
        'tx_scheduler_ProgressProvider' => 'TYPO3\\CMS\\Scheduler\\ProgressProviderInterface',
        'tx_scheduler' => 'TYPO3\\CMS\\Scheduler\\Scheduler',
-       'tx_scheduler_Task' => 'TYPO3\\CMS\\Scheduler\\Task',
+       'tx_scheduler_Task' => 'TYPO3\\CMS\\Scheduler\\Task\\AbstractTask',
        'tx_scheduler_CachingFrameworkGarbageCollection_AdditionalFieldProvider' => 'TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionAdditionalFieldProvider',
        'tx_scheduler_CachingFrameworkGarbageCollection' => 'TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask',
        'tx_scheduler_FileIndexing' => 'TYPO3\\CMS\\Scheduler\\Task\\FileIndexingTask',
index 07474db..4857bb3 100644 (file)
@@ -63,7 +63,7 @@ if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI && basename(PATH_thisScript) == 'c
                        // Try getting the next task and execute it
                        // If there are no more tasks to execute, an exception is thrown by tx_scheduler::fetchTask()
                        try {
-                               /** @var $task \TYPO3\CMS\Scheduler\Task */
+                               /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask */
                                $task = $scheduler->fetchTask();
                                $hasTask = TRUE;
                                try {