forked from AOEpeople/TYPO3_Restler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
35 lines (31 loc) · 1.58 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
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// add restler-configuration-class
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['restler']['restlerConfigurationClasses'][] = 'Aoe\\Restler\\System\\Restler\\Configuration';
/**
* register cache which can cache response of REST-endpoints
*/
if (false === isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_restler'])) {
// only configure cache, when cache is not already configured (e.g. by any other extension which base on this extension)
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_restler'] = [
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
'options' => ['defaultLifetime' => 0]
];
}
/**
* register cache which will be used from restler (to e.g. cache the routes.php)
*/
if (false === isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_restler_cache'])) {
// only configure cache, when cache is not already configured (e.g. by any other extension which base on this extension)
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_restler_cache'] = [
'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
'groups' => ['system']
];
}
if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE) {
// Register request handler for API
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->registerRequestHandlerImplementation(\Aoe\Restler\Http\RestRequestHandler::class);
}