X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/blobdiff_plain/b7ed87c2278fc3ea4d18e8aefa4c0ad829165829..6a7369d976274f0868b6aa3217e3fb42eab5e00f:/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php diff --git a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php index b4ee4199fed1..0c3f2a73fc8e 100644 --- a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php +++ b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php @@ -20,7 +20,7 @@ namespace TYPO3\CMS\Scheduler\Task; * This task deletes rows from tables older than the given number of days. * * Available tables must be registered in - * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'] + * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'] * See ext_localconf.php of scheduler extension for an example * * @author Christian Kuhn @@ -49,7 +49,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask * @return bool TRUE if task run was successful */ public function execute() { - $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']; + $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']; $tableHandled = FALSE; foreach ($tableConfigurations as $tableName => $configuration) { if ($this->allTables || $tableName === $this->table) { @@ -58,7 +58,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask } } if (!$tableHandled) { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399); } return TRUE; } @@ -83,18 +83,18 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask $deleteTimestamp = strtotime('-' . $this->numberOfDays . 'days'); } else { if (!isset($configuration['expirePeriod'])) { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: No expirePeriod defined for table ' . $table, 1308355095); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' misconfiguration: No expirePeriod defined for table ' . $table, 1308355095); } $deleteTimestamp = strtotime('-' . $configuration['expirePeriod'] . 'days'); } $where = $configuration['dateField'] . ' < ' . $deleteTimestamp; } else { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: Either expireField or dateField must be defined for table ' . $table, 1308355268); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' 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\\Task\\TableGarbageCollectionTask failed for table ' . $this->table . ' with error: ' . $error, 1308255491); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' failed for table ' . $this->table . ' with error: ' . $error, 1308255491); } return TRUE; }