[FEATURE] Add table garbage collection scheduler task
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / ext_localconf.php
1 <?php
2
3 if (!defined ('TYPO3_MODE')) {
4 die ('Access denied.');
5 }
6
7 // Register the Scheduler as a possible key for CLI calls
8 $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = array(
9 'EXT:' . $_EXTKEY . '/cli/scheduler_cli_dispatch.php', '_CLI_scheduler'
10 );
11
12 // Get the extensions's configuration
13 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['scheduler']);
14
15 // If sample tasks should be shown,
16 // register information for the test and sleep tasks
17 if (!empty($extConf['showSampleTasks'])) {
18 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TestTask'] = array(
19 'extension' => $_EXTKEY,
20 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:testTask.name',
21 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:testTask.description',
22 'additionalFields' => 'tx_scheduler_TestTask_AdditionalFieldProvider'
23 );
24 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_SleepTask'] = array(
25 'extension' => $_EXTKEY,
26 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:sleepTask.name',
27 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:sleepTask.description',
28 'additionalFields' => 'tx_scheduler_SleepTask_AdditionalFieldProvider'
29 );
30 }
31
32 // Add caching framework garbage collection task
33 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_CachingFrameworkGarbageCollection'] = array(
34 'extension' => $_EXTKEY,
35 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.name',
36 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.description',
37 'additionalFields' => 'tx_scheduler_CachingFrameworkGarbageCollection_AdditionalFieldProvider',
38 );
39
40 // Add table garbage collection task
41 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection'] = array(
42 'extension' => $_EXTKEY,
43 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tableGarbageCollection.name',
44 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tableGarbageCollection.description',
45 'additionalFields' => 'tx_scheduler_TableGarbageCollection_AdditionalFieldProvider',
46 );
47 // Initialize option array of table garbage collection task if not already done by some other extension or localconf.php
48 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options'])) {
49 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options'] = array();
50 }
51 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables'])) {
52 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables'] = array();
53 }
54 // Register sys_log table in table garbage collection task
55 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables']['sys_log'])) {
56 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables']['sys_log'] = array(
57 'dateField' => 'tstamp',
58 'expirePeriod' => 180,
59 );
60 }
61 // Register cache_pages table in table garbage collection task
62 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables']['cache_pages'])) {
63 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_scheduler_TableGarbageCollection']['options']['tables']['cache_pages'] = array(
64 'expireField' => 'expires',
65 );
66 }
67 ?>