forked from lochmueller/staticfilecache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
executable file
·91 lines (77 loc) · 4.27 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
// declare(strict_types=1);
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$_EXTCONF = unserialize($_EXTCONF);
// Register with "crawler" extension:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions']['tx_staticfilecache_clearstaticfile'] = 'clear static cache file';
// Hook to process clearing static cached files if "crawler" extension is active:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'][$_EXTKEY] = \SFC\Staticfilecache\Hook\Crawler::class . '->clearStaticFile';
// Log a cache miss if no_cache is true
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'][$_EXTKEY] = \SFC\Staticfilecache\Hook\LogNoCache::class . '->log';
// Create cache (Note: "cache" has to be in lower case)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'][$_EXTKEY] = \SFC\Staticfilecache\StaticFileCache::class;
// Set cookie when User logs in
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'][$_EXTKEY] = \SFC\Staticfilecache\Hook\InitFrontendUser::class . '->setFeUserCookie';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'][$_EXTKEY] = \SFC\Staticfilecache\Hook\LogoffFrontendUser::class . '->logoff';
// register command controller
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = \SFC\Staticfilecache\Command\CacheCommandController::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = \SFC\Staticfilecache\Command\PublishCommandController::class;
$ruleClasses = [
// Ensure functionality until https://forge.typo3.org/issues/83212 is fixed
// \SFC\Staticfilecache\Cache\Rule\StaticCacheable::class,
\SFC\Staticfilecache\Cache\Rule\ValidUri::class,
\SFC\Staticfilecache\Cache\Rule\ValidDoktype::class,
\SFC\Staticfilecache\Cache\Rule\NoWorkspacePreview::class,
\SFC\Staticfilecache\Cache\Rule\NoUserOrGroupSet::class,
\SFC\Staticfilecache\Cache\Rule\NoIntScripts::class,
\SFC\Staticfilecache\Cache\Rule\LoginDeniedConfiguration::class,
\SFC\Staticfilecache\Cache\Rule\PageCacheable::class,
\SFC\Staticfilecache\Cache\Rule\NoNoCache::class,
\SFC\Staticfilecache\Cache\Rule\NoBackendUser::class,
\SFC\Staticfilecache\Cache\Rule\Enable::class,
\SFC\Staticfilecache\Cache\Rule\ValidRequestMethod::class,
\SFC\Staticfilecache\Cache\Rule\ForceStaticCache::class,
\SFC\Staticfilecache\Cache\Rule\NoFakeFrontend::class
];
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
foreach ($ruleClasses as $class) {
$signalSlotDispatcher->connect(\SFC\Staticfilecache\StaticFileCache::class, 'cacheRule', $class, 'check');
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['staticfilecache'] = [
'frontend' => \SFC\Staticfilecache\Cache\UriFrontend::class,
'backend' => \SFC\Staticfilecache\Cache\StaticFileBackend::class,
'groups' => [
'pages',
'all',
]
];
// Disable staticfilecache in development if extension configuration 'disableInDevelopment' is set
if ($_EXTCONF['disableInDevelopment'] && \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->isDevelopment()) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['staticfilecache']['backend'] = \TYPO3\CMS\Core\Cache\Backend\NullBackend::class;
}
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'brand-amazon',
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
['name' => 'amazon']
);
$iconRegistry->registerIcon(
'brand-paypal',
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
['name' => 'paypal']
);
$iconRegistry->registerIcon(
'documentation-book',
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
['name' => 'book']
);
$iconRegistry->registerIcon(
'brand-patreon',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
[
'source' => 'EXT:staticfilecache/Resources/Public/Icons/Patreon.svg'
]
);