search_core/ext_localconf.php

58 lines
2.2 KiB
PHP
Raw Normal View History

2016-12-09 13:19:35 +01:00
<?php
call_user_func(
function ($extensionKey) {
// TODO: Add hook for Extbase -> to handle records modified through
// Frontend and backend modules not using datahandler
$GLOBALS['TYPO3_CONF_VARS'] = TYPO3\CMS\Extbase\Utility\ArrayUtility::arrayMergeRecursiveOverrule(
$GLOBALS['TYPO3_CONF_VARS'],
[
'SC_OPTIONS' => [
'extbase' => [
'commandControllers' => [
Codappix\SearchCore\Command\IndexCommandController::class,
2016-12-09 13:19:35 +01:00
],
],
2016-12-13 16:43:51 +01:00
't3lib/class.t3lib_tcemain.php' => [
'clearCachePostProc' => [
$extensionKey => \Codappix\SearchCore\Hook\DataHandler::class . '->clearCachePostProc',
],
2016-12-13 16:43:51 +01:00
'processCmdmapClass' => [
2017-07-07 16:14:41 +02:00
$extensionKey => \Codappix\SearchCore\Hook\DataHandler::class,
2016-12-13 16:43:51 +01:00
],
'processDatamapClass' => [
2017-07-07 16:14:41 +02:00
$extensionKey => \Codappix\SearchCore\Hook\DataHandler::class,
2016-12-13 16:43:51 +01:00
],
],
2016-12-09 13:19:35 +01:00
],
]
);
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Codappix.' . $extensionKey,
2016-12-09 13:19:35 +01:00
'search',
2017-10-29 11:32:21 +01:00
[
'Search' => 'search'
],
2016-12-09 13:19:35 +01:00
[
'Search' => 'search'
]
);
// API does make use of object manager, therefore use GLOBALS
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey]);
if ($extensionConfiguration === false
|| !isset($extensionConfiguration['disable.']['elasticsearch'])
|| $extensionConfiguration['disable.']['elasticsearch'] !== '1'
) {
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
->registerImplementation(
\Codappix\SearchCore\Connection\ConnectionInterface::class,
\Codappix\SearchCore\Connection\Elasticsearch::class
);
}
2016-12-09 13:19:35 +01:00
},
$_EXTKEY
);