2 namespace TYPO3\CMS\Scheduler\Task;
51 $tableConfigurations =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'scheduler'][
'tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class][
'options'][
'tables'];
52 $tableHandled =
false;
53 foreach ($tableConfigurations as $tableName => $configuration) {
54 if ($this->allTables || $tableName === $this->table) {
60 throw new \RuntimeException(\TYPO3\CMS\
Scheduler\Task\TableGarbageCollectionTask::class .
' misconfiguration: ' . $this->table .
' does not exist in configuration', 1308354399);
75 if (!empty($configuration[
'expireField'])) {
76 $field = $configuration[
'expireField'];
80 $where = $field .
' <= \'' . $dateLimit .
'\' AND
' . $field . ' > \
'0\'';
81 }
elseif (!empty($configuration[
'dateField'])) {
82 if (!$this->allTables) {
83 $deleteTimestamp = strtotime(
'-' . $this->numberOfDays .
'days');
85 if (!isset($configuration[
'expirePeriod'])) {
86 throw new \RuntimeException(\TYPO3\CMS\
Scheduler\Task\TableGarbageCollectionTask::class .
' misconfiguration: No expirePeriod defined for table ' .
$table, 1308355095);
88 $deleteTimestamp = strtotime(
'-' . $configuration[
'expirePeriod'] .
'days');
90 $where = $configuration[
'dateField'] .
' < ' . $deleteTimestamp;
92 throw new \RuntimeException(\TYPO3\CMS\
Scheduler\Task\TableGarbageCollectionTask::class .
' misconfiguration: Either expireField or dateField must be defined for table ' .
$table, 1308355268);
95 $error =
$GLOBALS[
'TYPO3_DB']->sql_error();
97 throw new \RuntimeException(\TYPO3\CMS\
Scheduler\Task\TableGarbageCollectionTask::class .
' failed for table ' . $this->table .
' with error: ' . $error, 1308255491);
109 if ($this->allTables) {
110 $message =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.tableGarbageCollection.additionalInformationAllTables');
112 $message = sprintf(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.tableGarbageCollection.additionalInformationTable'), $this->table);