@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | // Checkbox for commit |
| 59 | 59 | $fieldName = 'commit'; |
| 60 | - $fieldId = 'task_' . $fieldName; |
|
| 61 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . ($taskInfo['commit'] ? ' checked="checked"' : '') . '>'; |
|
| 60 | + $fieldId = 'task_'.$fieldName; |
|
| 61 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'.($taskInfo['commit'] ? ' checked="checked"' : '').'>'; |
|
| 62 | 62 | $additionalFields[$fieldId] = [ |
| 63 | 63 | 'code' => $fieldHtml, |
| 64 | 64 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.commit', |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | // Checkbox for optimize |
| 70 | 70 | $fieldName = 'optimize'; |
| 71 | - $fieldId = 'task_' . $fieldName; |
|
| 72 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . ($taskInfo['optimize'] ? ' checked="checked"' : '') . '>'; |
|
| 71 | + $fieldId = 'task_'.$fieldName; |
|
| 72 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'.($taskInfo['optimize'] ? ' checked="checked"' : '').'>'; |
|
| 73 | 73 | $additionalFields[$fieldId] = [ |
| 74 | 74 | 'code' => $fieldHtml, |
| 75 | 75 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.optimize', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->renderToolByName('renderScoreTool'); |
| 107 | 107 | break; |
| 108 | 108 | default: |
| 109 | - $this->logger->warning('Incorrect tool configuration: "' . $this->settings['tools'] . '". Tool "' . $tool . '" does not exist.'); |
|
| 109 | + $this->logger->warning('Incorrect tool configuration: "'.$this->settings['tools'].'". Tool "'.$tool.'" does not exist.'); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $file['url'] = $this->currentDocument->getDownloadLocation($fileId); |
| 319 | 319 | $file['mimetype'] = $this->currentDocument->getFileMimeType($fileId); |
| 320 | 320 | } else { |
| 321 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
| 321 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | return $file; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | empty($firstPageLink) |
| 427 | 427 | && empty($secondPageLink) |
| 428 | 428 | ) { |
| 429 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
| 429 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | if (!empty($firstPageLink)) { |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | if (empty($workLink)) { |
| 467 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
| 467 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
| 468 | 468 | } |
| 469 | 469 | return $workLink; |
| 470 | 470 | } |
@@ -66,15 +66,15 @@ discard block |
||
| 66 | 66 | $_EXTKEY = 'dlf'; |
| 67 | 67 | // Register tools for toolbox plugin. |
| 68 | 68 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
| 69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_scoretool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.scoretool'; |
|
| 70 | -$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/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
| 71 | -$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/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
| 72 | -$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/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 73 | -$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/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
| 74 | -$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/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 75 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_modeldownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.modeldownloadtool'; |
|
| 76 | -$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/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 77 | -$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/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
| 69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_scoretool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.scoretool'; |
|
| 70 | +$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/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
| 71 | +$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/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
| 72 | +$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/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 73 | +$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/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
| 74 | +$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/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 75 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_modeldownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.modeldownloadtool'; |
|
| 76 | +$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/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 77 | +$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/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
| 78 | 78 | // Register hooks. |
| 79 | 79 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 80 | 80 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ]; |
| 113 | 113 | // Register AJAX eID handlers. |
| 114 | 114 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['general']['enableInternalProxy'] ?? false) { |
| 115 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
|
| 115 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class.'::main'; |
|
| 116 | 116 | } |
| 117 | 117 | // Use Caching Framework for Solr queries |
| 118 | 118 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'] ??= []; |
@@ -74,12 +74,12 @@ |
||
| 74 | 74 | $solr = Solr::getInstance($input->getOption('solr')); |
| 75 | 75 | // Connect to Solr server. |
| 76 | 76 | if (!$solr->ready) { |
| 77 | - $io->error('ERROR: Connection to Solr core ("' . $input->getOption('solr') . '") not possible \n'); |
|
| 77 | + $io->error('ERROR: Connection to Solr core ("'.$input->getOption('solr').'") not possible \n'); |
|
| 78 | 78 | return BaseCommand::FAILURE; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if (!$solr->suggestBuild()) { |
| 82 | - $io->error('ERROR: Sending the command suggest.build=true to Solr core ("' . $input->getOption('solr') . '") not possible \n'); |
|
| 82 | + $io->error('ERROR: Sending the command suggest.build=true to Solr core ("'.$input->getOption('solr').'") not possible \n'); |
|
| 83 | 83 | return BaseCommand::FAILURE; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $this->initializeRepositories((int) $input->getOption('pid')); |
| 105 | 105 | |
| 106 | 106 | if ($this->storagePid == 0) { |
| 107 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
| 107 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
| 108 | 108 | return BaseCommand::FAILURE; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 120 | 120 | $outputSolrCores = []; |
| 121 | 121 | foreach ($allSolrCores as $indexName => $uid) { |
| 122 | - $outputSolrCores[] = $uid . ' : ' . $indexName; |
|
| 122 | + $outputSolrCores[] = $uid.' : '.$indexName; |
|
| 123 | 123 | } |
| 124 | 124 | if (empty($outputSolrCores)) { |
| 125 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
| 125 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
| 126 | 126 | return BaseCommand::FAILURE; |
| 127 | 127 | } else { |
| 128 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $outputSolrCores) . "\n"); |
|
| 128 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $outputSolrCores)."\n"); |
|
| 129 | 129 | return BaseCommand::FAILURE; |
| 130 | 130 | } |
| 131 | 131 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $document = $this->documentRepository->findByUid($input->getOption('doc')); |
| 166 | 166 | |
| 167 | 167 | if ($document === null) { |
| 168 | - $io->error('ERROR: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . ' .'); |
|
| 168 | + $io->error('ERROR: Document with UID "'.$input->getOption('doc').'" could not be found on PID '.$this->storagePid.' .'); |
|
| 169 | 169 | return BaseCommand::FAILURE; |
| 170 | 170 | } else { |
| 171 | 171 | $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true); |
@@ -178,31 +178,31 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($doc === null) { |
| 181 | - $io->error('ERROR: Document "' . $input->getOption('doc') . '" could not be loaded.'); |
|
| 181 | + $io->error('ERROR: Document "'.$input->getOption('doc').'" could not be loaded.'); |
|
| 182 | 182 | return BaseCommand::FAILURE; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | $document->setSolrcore($solrCoreUid); |
| 186 | 186 | |
| 187 | 187 | if ($dryRun) { |
| 188 | - $io->section('DRY RUN: Would index ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 188 | + $io->section('DRY RUN: Would index '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 189 | 189 | $io->success('All done!'); |
| 190 | 190 | return BaseCommand::SUCCESS; |
| 191 | 191 | } else { |
| 192 | 192 | $document->setCurrentDocument($doc); |
| 193 | 193 | |
| 194 | 194 | if ($io->isVerbose()) { |
| 195 | - $io->section('Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . '.'); |
|
| 195 | + $io->section('Indexing '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.'.'); |
|
| 196 | 196 | } |
| 197 | 197 | $isSaved = $this->saveToDatabase($document, $input->getOption('softCommit')); |
| 198 | 198 | |
| 199 | 199 | if ($isSaved) { |
| 200 | 200 | if ($io->isVerbose()) { |
| 201 | - $io->section('Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on Solr core ' . $solrCoreUid . '.'); |
|
| 201 | + $io->section('Indexing '.$document->getUid().' ("'.$document->getLocation().'") on Solr core '.$solrCoreUid.'.'); |
|
| 202 | 202 | } |
| 203 | 203 | $isSaved = Indexer::add($document, $this->documentRepository, $input->getOption('softCommit')); |
| 204 | 204 | } else { |
| 205 | - $io->error('ERROR: Document with UID "' . $document->getUid() . '" could not be indexed on PID ' . $this->storagePid . ' . There are missing mandatory fields (at least one of those: ' . $this->extConf['general']['requiredMetadataFields'] . ') in this document.'); |
|
| 205 | + $io->error('ERROR: Document with UID "'.$document->getUid().'" could not be indexed on PID '.$this->storagePid.' . There are missing mandatory fields (at least one of those: '.$this->extConf['general']['requiredMetadataFields'].') in this document.'); |
|
| 206 | 206 | return BaseCommand::FAILURE; |
| 207 | 207 | } |
| 208 | 208 | |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | return BaseCommand::SUCCESS; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - $io->error('ERROR: Document with UID "' . $document->getUid() . '" could not be indexed on Solr core ' . $solrCoreUid . ' . There are missing mandatory fields (at least one of those: ' . $this->extConf['general']['requiredMetadataFields'] . ') in this document.'); |
|
| 215 | - $io->info('INFO: Document with UID "' . $document->getUid() . '" is already in database. If you want to keep the database and index consistent you need to remove it.'); |
|
| 214 | + $io->error('ERROR: Document with UID "'.$document->getUid().'" could not be indexed on Solr core '.$solrCoreUid.' . There are missing mandatory fields (at least one of those: '.$this->extConf['general']['requiredMetadataFields'].') in this document.'); |
|
| 215 | + $io->info('INFO: Document with UID "'.$document->getUid().'" is already in database. If you want to keep the database and index consistent you need to remove it.'); |
|
| 216 | 216 | return BaseCommand::FAILURE; |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | // in which case metadata of toplevel entry isn't yet filled. |
| 229 | 229 | if (empty($document['metadata'])) { |
| 230 | 230 | $document['metadata'] = $this->fetchToplevelMetadataFromSolr([ |
| 231 | - 'query' => 'uid:' . $document['uid'], |
|
| 231 | + 'query' => 'uid:'.$document['uid'], |
|
| 232 | 232 | 'start' => 0, |
| 233 | 233 | 'rows' => 1, |
| 234 | 234 | 'sort' => ['score' => 'desc'], |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if (empty($document['title']) && $document['partOf'] > 0) { |
| 240 | 240 | $superiorTitle = AbstractDocument::getTitle($document['partOf'], true); |
| 241 | 241 | if (!empty($superiorTitle)) { |
| 242 | - $document['title'] = '[' . $superiorTitle . ']'; |
|
| 242 | + $document['title'] = '['.$superiorTitle.']'; |
|
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -374,13 +374,13 @@ discard block |
||
| 374 | 374 | // Set search query. |
| 375 | 375 | if ( |
| 376 | 376 | !empty($this->searchParams['fulltext']) |
| 377 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($this->searchParams['query'] ?? ''), $matches) |
|
| 377 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($this->searchParams['query'] ?? ''), $matches) |
|
| 378 | 378 | ) { |
| 379 | 379 | // If the query already is a fulltext query e.g using the facets |
| 380 | 380 | $this->searchParams['query'] = empty($matches[1]) ? $this->searchParams['query'] : $matches[1]; |
| 381 | 381 | // Search in fulltext field if applicable. Query must not be empty! |
| 382 | 382 | if (!empty($this->searchParams['query'])) { |
| 383 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')'; |
|
| 383 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($this->searchParams['query'])).')'; |
|
| 384 | 384 | } |
| 385 | 385 | $params['fulltext'] = true; |
| 386 | 386 | } else { |
@@ -403,9 +403,9 @@ discard block |
||
| 403 | 403 | in_array($this->searchParams['extOperator'][$i], $allowedOperators) |
| 404 | 404 | ) { |
| 405 | 405 | if (!empty($query)) { |
| 406 | - $query .= ' ' . $this->searchParams['extOperator'][$i] . ' '; |
|
| 406 | + $query .= ' '.$this->searchParams['extOperator'][$i].' '; |
|
| 407 | 407 | } |
| 408 | - $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($this->searchParams['extQuery'][$i]) . ')'; |
|
| 408 | + $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($this->searchParams['extQuery'][$i]).')'; |
|
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | } |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | // Add filter query for date search |
| 415 | 415 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 416 | 416 | // combine dateFrom and dateTo into range search |
| 417 | - $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 417 | + $params['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | // Add filter query for faceting. |
@@ -431,12 +431,12 @@ discard block |
||
| 431 | 431 | ) { |
| 432 | 432 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
| 433 | 433 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
| 434 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 435 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 436 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . '"' . ' OR {!join from=' |
|
| 437 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 438 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . ' OR ' |
|
| 439 | - . $fields['uid'] . ':' . $this->searchParams['documentId']; |
|
| 434 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 435 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
| 436 | + . $fields['uid'].':'.$this->searchParams['documentId'].'"'.' OR {!join from=' |
|
| 437 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 438 | + . $fields['uid'].':'.$this->searchParams['documentId'].' OR ' |
|
| 439 | + . $fields['uid'].':'.$this->searchParams['documentId']; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // if collections are given, we prepare the collection query string |
@@ -456,8 +456,8 @@ discard block |
||
| 456 | 456 | if ($this->listedMetadata) { |
| 457 | 457 | foreach ($this->listedMetadata as $metadata) { |
| 458 | 458 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 459 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 460 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 459 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 460 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 461 | 461 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 462 | 462 | } |
| 463 | 463 | } |
@@ -532,8 +532,8 @@ discard block |
||
| 532 | 532 | if ($this->searchParams['fulltext'] == '1') { |
| 533 | 533 | $searchResult['snippet'] = $doc['snippet']; |
| 534 | 534 | $searchResult['highlight'] = $doc['highlight']; |
| 535 | - $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 536 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 535 | + $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 536 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 537 | 537 | preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
| 538 | 538 | } |
| 539 | 539 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | |
| 558 | 558 | // Fetch metadata for the current batch |
| 559 | 559 | $metadataOf = $this->fetchToplevelMetadataFromSolr([ |
| 560 | - 'query' => 'partof:' . $doc['uid'], |
|
| 560 | + 'query' => 'partof:'.$doc['uid'], |
|
| 561 | 561 | 'start' => $start, |
| 562 | 562 | 'rows' => min($batchSize, $totalChildren - $start), |
| 563 | 563 | ]); |
@@ -609,8 +609,8 @@ discard block |
||
| 609 | 609 | if ($this->listedMetadata) { |
| 610 | 610 | foreach ($this->listedMetadata as $metadata) { |
| 611 | 611 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 612 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 613 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 612 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 613 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 614 | 614 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 615 | 615 | } |
| 616 | 616 | } |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | $cache = null; |
| 662 | 662 | // Calculate cache identifier. |
| 663 | 663 | if ($enableCache === true) { |
| 664 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
| 664 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
| 665 | 665 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 666 | 666 | } |
| 667 | 667 | $resultSet = [ |
@@ -679,8 +679,8 @@ discard block |
||
| 679 | 679 | if ($this->indexedMetadata) { |
| 680 | 680 | foreach ($this->indexedMetadata as $metadata) { |
| 681 | 681 | if ($metadata->getIndexIndexed()) { |
| 682 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . 'i'; |
|
| 683 | - $queryFields .= $listMetadataRecord . '^' . $metadata->getIndexBoost() . ' '; |
|
| 682 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').'i'; |
|
| 683 | + $queryFields .= $listMetadataRecord.'^'.$metadata->getIndexBoost().' '; |
|
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | } |
@@ -766,24 +766,24 @@ discard block |
||
| 766 | 766 | foreach ($this->collections as $collection) { |
| 767 | 767 | // check for virtual collections query string |
| 768 | 768 | if ($collection->getIndexSearch()) { |
| 769 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collection->getIndexSearch() . ')' : ' OR (' . $collection->getIndexSearch() . ')'; |
|
| 769 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collection->getIndexSearch().')' : ' OR ('.$collection->getIndexSearch().')'; |
|
| 770 | 770 | } else { |
| 771 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collection->getIndexName() . '"' : ' OR "' . $collection->getIndexName() . '"'; |
|
| 771 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collection->getIndexName().'"' : ' OR "'.$collection->getIndexName().'"'; |
|
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | // distinguish between simple collection browsing and actual searching within the collection(s) |
| 776 | 776 | if (!empty($collectionsQueryString)) { |
| 777 | 777 | if (empty($query)) { |
| 778 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
| 778 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
| 779 | 779 | } else { |
| 780 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
| 780 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
| 781 | 781 | } |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
| 785 | 785 | if (!empty($virtualCollectionsQueryString)) { |
| 786 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
| 786 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | // combine both query strings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | private function translateLanguageCode(&$doc): void |
| 862 | 862 | { |
| 863 | 863 | if (is_array($doc['metadata']) && array_key_exists('language', $doc['metadata'])) { |
| 864 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
| 864 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
| 865 | 865 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($language); |
| 866 | 866 | } |
| 867 | 867 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $xsd = '<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">'; |
| 48 | 48 | foreach ($this->schemes as $scheme) { |
| 49 | - $xsd .= '<xs:import namespace="' . $scheme["namespace"] . '" schemaLocation="' . $scheme["schemaLocation"] . '"/>'; |
|
| 49 | + $xsd .= '<xs:import namespace="'.$scheme["namespace"].'" schemaLocation="'.$scheme["schemaLocation"].'"/>'; |
|
| 50 | 50 | } |
| 51 | 51 | $xsd .= '</xs:schema>'; |
| 52 | 52 | return $value->schemaValidateSource($xsd); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | foreach ($configuration as $configurationItem) { |
| 56 | 56 | if (!class_exists($configurationItem["className"])) { |
| 57 | - $this->logger->error('Unable to load class ' . $configurationItem["className"] . '.'); |
|
| 57 | + $this->logger->error('Unable to load class '.$configurationItem["className"].'.'); |
|
| 58 | 58 | throw new InvalidArgumentException('Unable to load validator class.', 1723200537037); |
| 59 | 59 | } |
| 60 | 60 | $breakOnError = !isset($configurationItem["breakOnError"]) || $configurationItem["breakOnError"] !== "false"; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if (!$validator instanceof AbstractDlfValidator) { |
| 86 | - $this->logger->error($className . ' must be an instance of AbstractDlfValidator.'); |
|
| 86 | + $this->logger->error($className.' must be an instance of AbstractDlfValidator.'); |
|
| 87 | 87 | throw new InvalidArgumentException('Class must be an instance of AbstractDlfValidator.', 1723121212747); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | protected function isValid($value): void |
| 105 | 105 | { |
| 106 | 106 | if (!$value instanceof $this->valueClassName) { |
| 107 | - $this->logger->error('Value must be an instance of ' . $this->valueClassName . '.'); |
|
| 107 | + $this->logger->error('Value must be an instance of '.$this->valueClassName.'.'); |
|
| 108 | 108 | throw new InvalidArgumentException('Type of value is not valid.', 1723127564821); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -61,11 +61,11 @@ |
||
| 61 | 61 | protected function process(mixed $value): string |
| 62 | 62 | { |
| 63 | 63 | // using source from standard input |
| 64 | - $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], null, null, $value->saveXML()); |
|
| 64 | + $process = new Process(['java', '-jar', $this->jar, '-xsl:'.$this->xsl, '-s:-'], null, null, $value->saveXML()); |
|
| 65 | 65 | $process->run(); |
| 66 | 66 | // executes after the command finish |
| 67 | 67 | if (!$process->isSuccessful()) { |
| 68 | - $this->logger->error('Processing exits with code "' . $process->getExitCode() . '"'); |
|
| 68 | + $this->logger->error('Processing exits with code "'.$process->getExitCode().'"'); |
|
| 69 | 69 | throw new InvalidArgumentException('Processing was not successful.', 1724862680); |
| 70 | 70 | } |
| 71 | 71 | return $process->getOutput(); |