[BUGFIX] Tests: Incomplete mock in ext:scheduler
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / ext_localconf.php
1 <?php
2 if (!defined('TYPO3_MODE')) {
3 die('Access denied.');
4 }
5 // Register the Scheduler as a possible key for CLI calls
6 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = array(
7 'EXT:' . $_EXTKEY . '/cli/scheduler_cli_dispatch.php',
8 '_CLI_scheduler'
9 );
10 // Get the extensions's configuration
11 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['scheduler']);
12 // If sample tasks should be shown,
13 // register information for the test and sleep tasks
14 if (!empty($extConf['showSampleTasks'])) {
15 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Example\\TestTask'] = array(
16 'extension' => $_EXTKEY,
17 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:testTask.name',
18 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:testTask.description',
19 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Example\\TestTaskAdditionalFieldProvider'
20 );
21 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Example\\SleepTask'] = array(
22 'extension' => $_EXTKEY,
23 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:sleepTask.name',
24 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:sleepTask.description',
25 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Example\\SleepTaskAdditionalFieldProvider'
26 );
27 }
28 // Add caching framework garbage collection task
29 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask'] = array(
30 'extension' => $_EXTKEY,
31 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:cachingFrameworkGarbageCollection.name',
32 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:cachingFrameworkGarbageCollection.description',
33 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionAdditionalFieldProvider'
34 );
35 // Add file indexing task
36 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\FileIndexingTask'] = array(
37 'extension' => $_EXTKEY,
38 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileIndexing.name',
39 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileIndexing.description'
40 );
41
42 // Add task to index file in a storage
43 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\FileStorageIndexingTask'] = array(
44 'extension' => $_EXTKEY,
45 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileStorageIndexing.name',
46 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileStorageIndexing.description',
47 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\FileStorageIndexingAdditionalFieldProvider'
48 );
49
50 // Add task for extracting metadata from files in a storage
51 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\FileStorageExtractionTask'] = array(
52 'extension' => $_EXTKEY,
53 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileStorageExtraction.name',
54 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:fileStorageExtraction.description',
55 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\FileStorageExtractionAdditionalFieldProvider'
56
57 );
58
59 // Add recycler directory cleanup task. Windows is not supported
60 // because "filectime" does not change after moving a file
61 if (TYPO3_OS !== 'WIN') {
62 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\RecyclerGarbageCollectionTask'] = array(
63 'extension' => $_EXTKEY,
64 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:recyclerGarbageCollection.name',
65 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:recyclerGarbageCollection.description',
66 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\RecyclerGarbageCollectionAdditionalFieldProvider'
67 );
68 }
69
70 // Add table garbage collection task
71 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask'] = array(
72 'extension' => $_EXTKEY,
73 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:tableGarbageCollection.name',
74 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:tableGarbageCollection.description',
75 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionAdditionalFieldProvider'
76 );
77 // Initialize option array of table garbage collection task if not already done by some other extension or localconf.php
78 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options'])) {
79 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options'] = array();
80 }
81 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'])) {
82 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'] = array();
83 }
84 // Register sys_log and sys_history table in table garbage collection task
85 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_log'])) {
86 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_log'] = array(
87 'dateField' => 'tstamp',
88 'expirePeriod' => 180
89 );
90 }
91 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_history'])) {
92 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_history'] = array(
93 'dateField' => 'tstamp',
94 'expirePeriod' => 30
95 );
96 }