ext_tables.php 1.42 KB
Newer Older
Dirk Wildt's avatar
Dirk Wildt committed
1 2
<?php

Dirk Wildt's avatar
Dirk Wildt committed
3
if( !defined( 'TYPO3_MODE' ) )
Dirk Wildt's avatar
Dirk Wildt committed
4
{
Dirk Wildt's avatar
Dirk Wildt committed
5
	die( 'Access denied.' );
Dirk Wildt's avatar
Dirk Wildt committed
6 7
}

Dirk Wildt's avatar
Dirk Wildt committed
8 9 10 11
/* * ****************************************************************************
 * Set TYPO3 version
 * **************************************************************************** */

Dirk Wildt's avatar
Dirk Wildt committed
12
// #t1806, 171207, ~
Dirk Wildt's avatar
Dirk Wildt committed
13
list( $main, $sub, $bugfix ) = explode( '.', TYPO3_version );
Dirk Wildt's avatar
Dirk Wildt committed
14 15 16
$typo3Version = ( ( int ) $main ) * 1000000;
$typo3Version = $typo3Version + ( ( int ) $sub ) * 1000;
$typo3Version = $typo3Version + ( ( int ) $bugfix ) * 1;
Dirk Wildt's avatar
Dirk Wildt committed
17

Dirk Wildt's avatar
Dirk Wildt committed
18
switch( TRUE )
Dirk Wildt's avatar
Dirk Wildt committed
19
{
Dirk Wildt's avatar
Dirk Wildt committed
20 21 22 23
	case($typo3Version < 7006000):
	case($typo3Version < 8007000):
		require( PATH_typo3conf . 'ext/caddy/Configuration/ExtTables/7.6/index.php' );
		break;
Dirk Wildt's avatar
Dirk Wildt committed
24 25 26 27
	case($typo3Version < 9000000):
		require( PATH_typo3conf . 'ext/caddy/Configuration/ExtTables/8.7/index.php' );
		break;
	case($typo3Version >= 9000000):
Dirk Wildt's avatar
Dirk Wildt committed
28 29 30
	default:
		require( PATH_typo3conf . 'ext/caddy/Configuration/ExtTables/Default/index.php' );
		break;
Dirk Wildt's avatar
Dirk Wildt committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
}

call_user_func(
				function ()
{

	/**
	 * Garbage Collector
	 */
	$tgct = 'TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask';
	$tables = [
			// tx_caddy_item doesn't contain personal data, but hasn't any sense without tx_caddy_order
			'tx_caddy_item',
			'tx_caddy_order'
	];
	foreach( $tables as $table )
	{
		$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'SC_OPTIONS' ][ 'scheduler' ][ 'tasks' ][ $tgct ][ 'options' ][ 'tables' ][ $table ] = [
				'dateField' => 'tstamp',
				// three months
				'expirePeriod' => 180
		];
	}
}
);