@@ -120,7 +120,7 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | private function getQuery($fields, $parameters) |
| 122 | 122 | { |
| 123 | - return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
|
| 123 | + return $fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$fields['uid'].':'.$this->getUid($parameters['uid']); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $parameters = $request->getParsedBody(); |
| 46 | 46 | $solrCore = (string) $parameters['solrcore']; |
| 47 | 47 | $uHash = (string) $parameters['uHash']; |
| 48 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 48 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 49 | 49 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
| 50 | 50 | } |
| 51 | 51 | // Perform Solr query. |
@@ -65,22 +65,22 @@ |
||
| 65 | 65 | $_EXTKEY = 'dlf'; |
| 66 | 66 | // Register tools for toolbox plugin. |
| 67 | 67 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
| 68 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 68 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 75 | 75 | // Register hooks. |
| 76 | 76 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 77 | 77 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 78 | 78 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class; |
| 79 | 79 | // Register AJAX eID handlers. |
| 80 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class . '::main'; |
|
| 81 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class . '::main'; |
|
| 80 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class.'::main'; |
|
| 81 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class.'::main'; |
|
| 82 | 82 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) { |
| 83 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
|
| 83 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class.'::main'; |
|
| 84 | 84 | } |
| 85 | 85 | // Use Caching Framework for Solr queries |
| 86 | 86 | if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) { |
@@ -33,13 +33,13 @@ |
||
| 33 | 33 | $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings); |
| 34 | 34 | |
| 35 | 35 | // Set replacements. |
| 36 | - $args['###TITLES###'] = $foundNumbers['titles'] . ' ' . htmlspecialchars( |
|
| 36 | + $args['###TITLES###'] = $foundNumbers['titles'].' '.htmlspecialchars( |
|
| 37 | 37 | LocalizationUtility::translate( |
| 38 | 38 | ($foundNumbers['titles'] > 1 ? 'titles' : 'title'), 'dlf' |
| 39 | 39 | ) |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - $args['###VOLUMES###'] = $foundNumbers['volumes'] . ' ' . htmlspecialchars( |
|
| 42 | + $args['###VOLUMES###'] = $foundNumbers['volumes'].' '.htmlspecialchars( |
|
| 43 | 43 | LocalizationUtility::translate( |
| 44 | 44 | ($foundNumbers['volumes'] > 1 ? 'volumes' : 'volume'), 'dlf' |
| 45 | 45 | ) |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
| 72 | 72 | |
| 73 | 73 | if ($this->disableJsonWrappedResponse) { |
| 74 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
| 74 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
| 75 | 75 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 85 | 85 | |
| 86 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
| 86 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
| 87 | 87 | $this->httpClient = new HttpClient([ |
| 88 | 88 | 'base_uri' => $this->baseUrl, |
| 89 | 89 | 'http_errors' => false, |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | protected function addSiteConfig($identifier, $baseUrl) |
| 129 | 129 | { |
| 130 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
| 130 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
| 131 | 131 | $siteConfig['base'] = $baseUrl; |
| 132 | 132 | $siteConfig['languages'][0]['base'] = $baseUrl; |
| 133 | 133 | |
| 134 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
| 134 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
| 135 | 135 | @mkdir($siteConfigPath, 0775, true); |
| 136 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
| 136 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | protected function initializeRepository(string $className, int $storagePid) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 153 | 153 | |
| 154 | 154 | $updateQuery = $solr->service->createUpdate(); |
| 155 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
| 155 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
| 156 | 156 | $document = $updateQuery->createDocument(); |
| 157 | 157 | foreach ($jsonDoc as $key => $value) { |
| 158 | 158 | $document->setField($key, $value); |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | parent::setUp(); |
| 39 | 39 | |
| 40 | - $this->oaiUrl = $this->baseUrl . '/index.php?id=' . $this->oaiPage; |
|
| 41 | - $this->oaiUrlNoStoragePid = $this->baseUrl . '/index.php?id=' . $this->oaiPageNoStoragePid; |
|
| 40 | + $this->oaiUrl = $this->baseUrl.'/index.php?id='.$this->oaiPage; |
|
| 41 | + $this->oaiUrlNoStoragePid = $this->baseUrl.'/index.php?id='.$this->oaiPageNoStoragePid; |
|
| 42 | 42 | |
| 43 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml'); |
|
| 45 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml'); |
|
| 46 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml'); |
|
| 47 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 43 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml'); |
|
| 45 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml'); |
|
| 46 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml'); |
|
| 47 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 49 | 49 | |
| 50 | 50 | $this->persistenceManager = $this->objectManager->get(PersistenceManager::class); |
| 51 | 51 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $coreName = Solr::createCore(); |
| 63 | 63 | $solr = Solr::getInstance($coreName); |
| 64 | 64 | |
| 65 | - $this->importSolrDocuments($solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
| 65 | + $this->importSolrDocuments($solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $oaiCoreModel = $this->solrCoreRepository->findByUid(11001); |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); |
| 44 | 44 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
| 45 | 45 | |
| 46 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml'); |
|
| 47 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml'); |
|
| 48 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml'); |
|
| 46 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml'); |
|
| 47 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml'); |
|
| 48 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $core = $this->createSolrCore(); |
| 114 | 114 | |
| 115 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml'); |
|
| 116 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
| 117 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
| 115 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_fulltext.xml'); |
|
| 116 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
| 117 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
| 118 | 118 | |
| 119 | 119 | $collections = $this->collectionRepository->findCollectionsBySettings([ |
| 120 | 120 | 'index_name' => ['Musik', 'Projekt: Dresdner Hefte'], |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | $fulltext['mimetype'] = $this->document->getDoc()->getFileMimeType($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[$page]]['files'][$fileGrpFulltext]); |
| 147 | 147 | break; |
| 148 | 148 | } else { |
| 149 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
| 149 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | if (empty($fulltext)) { |
| 153 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['fileGrpFulltext'] . '"'); |
|
| 153 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['fileGrpFulltext'].'"'); |
|
| 154 | 154 | } |
| 155 | 155 | return $fulltext; |
| 156 | 156 | } |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | $viewerConfiguration = '$(document).ready(function() { |
| 169 | 169 | if (dlfUtils.exists(dlfViewer)) { |
| 170 | 170 | tx_dlf_viewer = new dlfViewer({ |
| 171 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
| 172 | - div: "' . $this->settings['elementId'] . '", |
|
| 173 | - progressElementId: "' . $this->settings['progressElementId'] . '", |
|
| 174 | - images: ' . json_encode($this->images) . ', |
|
| 175 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
| 176 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
| 177 | - useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ' |
|
| 171 | + controls: ["' . implode('", "', $this->controls).'"], |
|
| 172 | + div: "' . $this->settings['elementId'].'", |
|
| 173 | + progressElementId: "' . $this->settings['progressElementId'].'", |
|
| 174 | + images: ' . json_encode($this->images).', |
|
| 175 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
| 176 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
| 177 | + useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0).' |
|
| 178 | 178 | }); |
| 179 | 179 | } |
| 180 | 180 | });'; |
@@ -275,11 +275,11 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | break; |
| 277 | 277 | } else { |
| 278 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
| 278 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | if (empty($image)) { |
| 282 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['fileGrpImages'] . '"'); |
|
| 282 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['fileGrpImages'].'"'); |
|
| 283 | 283 | } |
| 284 | 284 | return $image; |
| 285 | 285 | } |
@@ -48,6 +48,6 @@ |
||
| 48 | 48 | $metadata['video_duration'] = [$videoDuration]; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: []; |
|
| 51 | + $metadata['duration'] = $metadata['video_duration'] ? : $metadata['audio_duration'] ? : []; |
|
| 52 | 52 | } |
| 53 | 53 | } |