forked from fabarea/rss_display
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
55 lines (45 loc) · 2.11 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
if (!defined('TYPO3_MODE')) die ('Access denied.');
// Define whether USER or USER_INT.
$pluginType = 'USER_INT';
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rss_display']);
if (!empty($configuration['plugin_type'])) {
$pluginType = $configuration['plugin_type'];
}
// Define whether to automatically load TS.
if (false === isset($configuration['autoload_typoscript']) || true === (bool)$configuration['autoload_typoscript']) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'rss_display',
'constants',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:rss_display/Configuration/TypoScript/constants.txt">'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'rss_display',
'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:rss_display/Configuration/TypoScript/setup.txt">'
);
}
// Configure Extbase plugin
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Fab.rss_display',
'Pi1',
['Feed' => 'show'],
$pluginType === 'USER_INT' ? ['Feed' => 'show'] : []
);
// cache configuration, see
// https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/CachingFramework/Configuration/Index.html#cache-configurations
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rssdisplay']['frontend'] = \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rssdisplay']['groups'] = ['all', 'rssdisplay'];
if (!\TYPO3\CMS\Core\Core\Environment::isComposerMode()) {
# Install PSR-0-compatible class autoloader for SimplePie Library in Resources/PHP/SimplePie
spl_autoload_register(function ($class) {
// Only load the class if it starts with "SimplePie"
if (strpos($class, 'SimplePie') !== 0) {
return;
}
require sprintf('%sResources/Private/PHP/SimplePie/%s',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rss_display'),
DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'
);
});
}