@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
| 125 | - $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
|
| 125 | + $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
|
| 126 | 126 | $listViewSearch = true; |
| 127 | 127 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
| 128 | 128 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $simplePagination = new SimplePagination($solrPaginator); |
| 184 | 184 | |
| 185 | 185 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
| 186 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
| 186 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | $this->view->assign('documents', !empty($solrResults) ? $solrResults : []); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
| 210 | 210 | if ($this->settings['suggest']) { |
| 211 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 211 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | $this->view->assign('viewData', $this->viewData); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | // Get facets from plugin configuration. |
| 230 | 230 | $facets = []; |
| 231 | 231 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
| 232 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 232 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | $searchParams = $this->searchParams; |
| 266 | 266 | if ( |
| 267 | 267 | (!empty($searchParams['fulltext'])) |
| 268 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 268 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 269 | 269 | ) { |
| 270 | 270 | // If the query already is a fulltext query e.g using the facets |
| 271 | 271 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 272 | 272 | // Search in fulltext field if applicable. Query must not be empty! |
| 273 | 273 | if (!empty($searchParams['query'])) { |
| 274 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 274 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 275 | 275 | } |
| 276 | 276 | } else { |
| 277 | 277 | // Retain given search field if valid. |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | // add filter query for date search |
| 289 | 289 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 290 | 290 | // combine dateFrom and dateTo into filterquery as range search |
| 291 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 291 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | // Add extended search query. |
@@ -306,9 +306,9 @@ discard block |
||
| 306 | 306 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 307 | 307 | ) { |
| 308 | 308 | if (!empty($search['query'])) { |
| 309 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 309 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 310 | 310 | } |
| 311 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 311 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -397,24 +397,24 @@ discard block |
||
| 397 | 397 | foreach ($collections as $collectionEntry) { |
| 398 | 398 | // check for virtual collections query string |
| 399 | 399 | if ($collectionEntry->getIndexSearch()) { |
| 400 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
| 400 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')'; |
|
| 401 | 401 | } else { |
| 402 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
|
| 402 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"'; |
|
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | // distinguish between simple collection browsing and actual searching within the collection(s) |
| 407 | 407 | if (!empty($collectionsQueryString)) { |
| 408 | 408 | if (empty($query)) { |
| 409 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
| 409 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
| 410 | 410 | } else { |
| 411 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
| 411 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
| 416 | 416 | if (!empty($virtualCollectionsQueryString)) { |
| 417 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
| 417 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $entryArray['doNotLinkIt'] = 0; |
| 445 | 445 | // Check if facet is already selected. |
| 446 | 446 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
| 447 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
| 447 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
| 448 | 448 | if ($index !== false) { |
| 449 | 449 | // Facet is selected, thus remove it from filter. |
| 450 | 450 | unset($queryColumn[$index]); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | } |
| 459 | 459 | } else { |
| 460 | 460 | // Facet is not selected, thus add it to filter. |
| 461 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
| 461 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
| 462 | 462 | $entryArray['ITEM_STATE'] = 'NO'; |
| 463 | 463 | } |
| 464 | 464 | $entryArray['queryColumn'] = $queryColumn; |
@@ -16,67 +16,67 @@ |
||
| 16 | 16 | // Plugin "audioplayer". |
| 17 | 17 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_audioplayer'] = 'layout,select_key,pages,recursive'; |
| 18 | 18 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_audioplayer'] = 'pi_flexform'; |
| 19 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
| 19 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/FlexForms/AudioPlayer.xml'); |
|
| 20 | 20 | // Plugin "basket". |
| 21 | 21 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive'; |
| 22 | 22 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform'; |
| 23 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Basket.xml'); |
|
| 23 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Basket.xml'); |
|
| 24 | 24 | // Plugin "calendar". |
| 25 | 25 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive'; |
| 26 | 26 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform'; |
| 27 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Calendar.xml'); |
|
| 27 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Calendar.xml'); |
|
| 28 | 28 | // Plugin "collection". |
| 29 | 29 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive'; |
| 30 | 30 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform'; |
| 31 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Collection.xml'); |
|
| 31 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Collection.xml'); |
|
| 32 | 32 | // Plugin "feeds". |
| 33 | 33 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive'; |
| 34 | 34 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform'; |
| 35 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Feeds.xml'); |
|
| 35 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Feeds.xml'); |
|
| 36 | 36 | // Plugin "listview". |
| 37 | 37 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive'; |
| 38 | 38 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform'; |
| 39 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/ListView.xml'); |
|
| 39 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/ListView.xml'); |
|
| 40 | 40 | // Plugin "metadata". |
| 41 | 41 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive'; |
| 42 | 42 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform'; |
| 43 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Metadata.xml'); |
|
| 43 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Metadata.xml'); |
|
| 44 | 44 | // Plugin "navigation". |
| 45 | 45 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive'; |
| 46 | 46 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform'; |
| 47 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Navigation.xml'); |
|
| 47 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Navigation.xml'); |
|
| 48 | 48 | // Plugin "oaipmh". |
| 49 | 49 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive'; |
| 50 | 50 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform'; |
| 51 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
| 51 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/FlexForms/OaiPmh.xml'); |
|
| 52 | 52 | // Plugin "pagegrid". |
| 53 | 53 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive'; |
| 54 | 54 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform'; |
| 55 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
| 55 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageGrid.xml'); |
|
| 56 | 56 | // Plugin "pageview". |
| 57 | 57 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive'; |
| 58 | 58 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform'; |
| 59 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageView.xml'); |
|
| 59 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageView.xml'); |
|
| 60 | 60 | // Plugin "search". |
| 61 | 61 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive'; |
| 62 | 62 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform'; |
| 63 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Search.xml'); |
|
| 63 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Search.xml'); |
|
| 64 | 64 | // Plugin "statistics". |
| 65 | 65 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive'; |
| 66 | 66 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform'; |
| 67 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Statistics.xml'); |
|
| 67 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Statistics.xml'); |
|
| 68 | 68 | // Plugin "tableofcontents". |
| 69 | 69 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive'; |
| 70 | 70 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform'; |
| 71 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
| 71 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/FlexForms/TableOfContents.xml'); |
|
| 72 | 72 | // Plugin "toolbox". |
| 73 | 73 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive'; |
| 74 | 74 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform'; |
| 75 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
| 75 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Toolbox.xml'); |
|
| 76 | 76 | // Plugin "view3d". |
| 77 | 77 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_view3d'] = 'layout,select_key,pages,recursive'; |
| 78 | 78 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_view3d'] = 'pi_flexform'; |
| 79 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/View3D.xml'); |
|
| 79 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:'.'dlf/Configuration/FlexForms/View3D.xml'); |
|
| 80 | 80 | |
| 81 | 81 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( |
| 82 | 82 | 'Dlf', |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // extract collection(s) from collection parameter |
| 83 | 83 | $collections = []; |
| 84 | 84 | if (array_key_exists('collection', $this->searchParams)) { |
| 85 | - foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) { |
|
| 85 | + foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) { |
|
| 86 | 86 | $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $simplePagination = new SimplePagination($solrPaginator); |
| 111 | 111 | |
| 112 | 112 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
| 113 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
| 113 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->view->assign('viewData', $this->viewData); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (empty(array_filter($metadata))) { |
| 139 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
| 139 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | ksort($metadata); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $this->parseMetadata($i, $name, $value, $metadata); |
| 175 | 175 | |
| 176 | 176 | if (is_array($metadata[$i][$name])) { |
| 177 | - $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function ($metadataValue) { |
|
| 177 | + $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) { |
|
| 178 | 178 | return !empty($metadataValue); |
| 179 | 179 | })); |
| 180 | 180 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 392 | 392 | $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true); |
| 393 | 393 | if (!empty($superiorTitle)) { |
| 394 | - $metadata[$i]['title'] = ['[' . $superiorTitle . ']']; |
|
| 394 | + $metadata[$i]['title'] = ['['.$superiorTitle.']']; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | $data['tx_dlf_metadata'][uniqid('NEW')] = [ |
| 252 | 252 | 'pid' => $this->pid, |
| 253 | - 'label' => $this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
| 253 | + 'label' => $this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
| 254 | 254 | 'index_name' => $indexName, |
| 255 | 255 | 'format' => implode(',', $formatIds), |
| 256 | 256 | 'default_value' => $values['default_value'], |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | 'pid' => $this->pid, |
| 290 | 290 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
| 291 | 291 | 'l18n_parent' => $id, |
| 292 | - 'label' => $this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
| 292 | + 'label' => $this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
| 293 | 293 | ]; |
| 294 | 294 | } |
| 295 | 295 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
| 317 | 317 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
| 318 | - $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
|
| 318 | + $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')'); |
|
| 319 | 319 | $indexName = Solr::createCore(''); |
| 320 | 320 | if (!empty($indexName)) { |
| 321 | 321 | $newRecord->setIndexName($indexName); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $data['tx_dlf_structures'][uniqid('NEW')] = [ |
| 356 | 356 | 'pid' => $this->pid, |
| 357 | 357 | 'toplevel' => $values['toplevel'], |
| 358 | - 'label' => $this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
| 358 | + 'label' => $this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
| 359 | 359 | 'index_name' => $indexName, |
| 360 | 360 | 'oai_name' => $values['oai_name'], |
| 361 | 361 | 'thumbnail' => 0, |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | 'pid' => $this->pid, |
| 381 | 381 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
| 382 | 382 | 'l18n_parent' => $id, |
| 383 | - 'label' => $this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
| 383 | + 'label' => $this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
| 384 | 384 | ]; |
| 385 | 385 | } |
| 386 | 386 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | } elseif (isset($langArray['default'][$index][0]['target'])) { |
| 476 | 476 | return $langArray['default'][$index][0]['target']; |
| 477 | 477 | } else { |
| 478 | - return 'Missing translation for ' . $index; |
|
| 478 | + return 'Missing translation for '.$index; |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | */ |
| 491 | 491 | private function getRecords(string $recordType): array |
| 492 | 492 | { |
| 493 | - $filePath = Environment::getPublicPath() . '/typo3conf/ext/dlf/Resources/Private/Data/' . $recordType . 'Defaults.json'; |
|
| 493 | + $filePath = Environment::getPublicPath().'/typo3conf/ext/dlf/Resources/Private/Data/'.$recordType.'Defaults.json'; |
|
| 494 | 494 | |
| 495 | 495 | $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); |
| 496 | 496 | $fileObject = $resourceFactory->getFileObjectFromCombinedIdentifier($filePath); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | // in which case metadata of toplevel entry isn't yet filled. |
| 228 | 228 | if (empty($document['metadata'])) { |
| 229 | 229 | $document['metadata'] = $this->fetchToplevelMetadataFromSolr([ |
| 230 | - 'query' => 'uid:' . $document['uid'], |
|
| 230 | + 'query' => 'uid:'.$document['uid'], |
|
| 231 | 231 | 'start' => 0, |
| 232 | 232 | 'rows' => 1, |
| 233 | 233 | 'sort' => ['score' => 'desc'], |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | if (empty($document['title']) && $document['partOf'] > 0) { |
| 239 | 239 | $superiorTitle = AbstractDocument::getTitle($document['partOf'], true); |
| 240 | 240 | if (!empty($superiorTitle)) { |
| 241 | - $document['title'] = '[' . $superiorTitle . ']'; |
|
| 241 | + $document['title'] = '['.$superiorTitle.']'; |
|
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | } |
@@ -373,13 +373,13 @@ discard block |
||
| 373 | 373 | // Set search query. |
| 374 | 374 | if ( |
| 375 | 375 | !empty($this->searchParams['fulltext']) |
| 376 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($this->searchParams['query'] ?? ''), $matches) |
|
| 376 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($this->searchParams['query'] ?? ''), $matches) |
|
| 377 | 377 | ) { |
| 378 | 378 | // If the query already is a fulltext query e.g using the facets |
| 379 | 379 | $this->searchParams['query'] = empty($matches[1]) ? $this->searchParams['query'] : $matches[1]; |
| 380 | 380 | // Search in fulltext field if applicable. Query must not be empty! |
| 381 | 381 | if (!empty($this->searchParams['query'])) { |
| 382 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')'; |
|
| 382 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($this->searchParams['query'])).')'; |
|
| 383 | 383 | } |
| 384 | 384 | $params['fulltext'] = true; |
| 385 | 385 | } else { |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | in_array($this->searchParams['extOperator'][$i], $allowedOperators) |
| 403 | 403 | ) { |
| 404 | 404 | if (!empty($query)) { |
| 405 | - $query .= ' ' . $this->searchParams['extOperator'][$i] . ' '; |
|
| 405 | + $query .= ' '.$this->searchParams['extOperator'][$i].' '; |
|
| 406 | 406 | } |
| 407 | - $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($this->searchParams['extQuery'][$i]) . ')'; |
|
| 407 | + $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($this->searchParams['extQuery'][$i]).')'; |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | } |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | // Add filter query for date search |
| 414 | 414 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
| 415 | 415 | // combine dateFrom and dateTo into range search |
| 416 | - $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
| 416 | + $params['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | // Add filter query for faceting. |
@@ -430,12 +430,12 @@ discard block |
||
| 430 | 430 | ) { |
| 431 | 431 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
| 432 | 432 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
| 433 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 434 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 435 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . '"' . ' OR {!join from=' |
|
| 436 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 437 | - . $fields['uid'] . ':' . $this->searchParams['documentId'] . ' OR ' |
|
| 438 | - . $fields['uid'] . ':' . $this->searchParams['documentId']; |
|
| 433 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 434 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
| 435 | + . $fields['uid'].':'.$this->searchParams['documentId'].'"'.' OR {!join from=' |
|
| 436 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 437 | + . $fields['uid'].':'.$this->searchParams['documentId'].' OR ' |
|
| 438 | + . $fields['uid'].':'.$this->searchParams['documentId']; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // if collections are given, we prepare the collection query string |
@@ -455,8 +455,8 @@ discard block |
||
| 455 | 455 | if ($this->listedMetadata) { |
| 456 | 456 | foreach ($this->listedMetadata as $metadata) { |
| 457 | 457 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 458 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 459 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 458 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 459 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 460 | 460 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 461 | 461 | } |
| 462 | 462 | } |
@@ -531,8 +531,8 @@ discard block |
||
| 531 | 531 | if ($this->searchParams['fulltext'] == '1') { |
| 532 | 532 | $searchResult['snippet'] = $doc['snippet']; |
| 533 | 533 | $searchResult['highlight'] = $doc['highlight']; |
| 534 | - $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 535 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 534 | + $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
| 535 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
| 536 | 536 | preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
| 537 | 537 | } |
| 538 | 538 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | |
| 557 | 557 | // Fetch metadata for the current batch |
| 558 | 558 | $metadataOf = $this->fetchToplevelMetadataFromSolr([ |
| 559 | - 'query' => 'partof:' . $doc['uid'], |
|
| 559 | + 'query' => 'partof:'.$doc['uid'], |
|
| 560 | 560 | 'start' => $start, |
| 561 | 561 | 'rows' => min($batchSize, $totalChildren - $start), |
| 562 | 562 | ]); |
@@ -608,8 +608,8 @@ discard block |
||
| 608 | 608 | if ($this->listedMetadata) { |
| 609 | 609 | foreach ($this->listedMetadata as $metadata) { |
| 610 | 610 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 611 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 612 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 611 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 612 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 613 | 613 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 614 | 614 | } |
| 615 | 615 | } |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | $cache = null; |
| 661 | 661 | // Calculate cache identifier. |
| 662 | 662 | if ($enableCache === true) { |
| 663 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
| 663 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
| 664 | 664 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 665 | 665 | } |
| 666 | 666 | $resultSet = [ |
@@ -678,8 +678,8 @@ discard block |
||
| 678 | 678 | if ($this->indexedMetadata) { |
| 679 | 679 | foreach ($this->indexedMetadata as $metadata) { |
| 680 | 680 | if ($metadata->getIndexIndexed()) { |
| 681 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . 'i'; |
|
| 682 | - $queryFields .= $listMetadataRecord . '^' . $metadata->getIndexBoost() . ' '; |
|
| 681 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').'i'; |
|
| 682 | + $queryFields .= $listMetadataRecord.'^'.$metadata->getIndexBoost().' '; |
|
| 683 | 683 | } |
| 684 | 684 | } |
| 685 | 685 | } |
@@ -765,24 +765,24 @@ discard block |
||
| 765 | 765 | foreach ($this->collections as $collection) { |
| 766 | 766 | // check for virtual collections query string |
| 767 | 767 | if ($collection->getIndexSearch()) { |
| 768 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collection->getIndexSearch() . ')' : ' OR (' . $collection->getIndexSearch() . ')'; |
|
| 768 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collection->getIndexSearch().')' : ' OR ('.$collection->getIndexSearch().')'; |
|
| 769 | 769 | } else { |
| 770 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collection->getIndexName() . '"' : ' OR "' . $collection->getIndexName() . '"'; |
|
| 770 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collection->getIndexName().'"' : ' OR "'.$collection->getIndexName().'"'; |
|
| 771 | 771 | } |
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | // distinguish between simple collection browsing and actual searching within the collection(s) |
| 775 | 775 | if (!empty($collectionsQueryString)) { |
| 776 | 776 | if (empty($query)) { |
| 777 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
| 777 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
| 778 | 778 | } else { |
| 779 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
| 779 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
| 784 | 784 | if (!empty($virtualCollectionsQueryString)) { |
| 785 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
| 785 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | // combine both query strings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | private function translateLanguageCode(&$doc): void |
| 861 | 861 | { |
| 862 | 862 | if (array_key_exists('language', $doc['metadata'])) { |
| 863 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
| 863 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
| 864 | 864 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($language); |
| 865 | 865 | } |
| 866 | 866 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $parent->setCurrentDocument($doc); |
| 114 | 114 | $success = self::add($parent, $documentRepository); |
| 115 | 115 | } else { |
| 116 | - Helper::log('Could not load parent document with UID ' . $document->getCurrentDocument()->parentId, LOG_SEVERITY_ERROR); |
|
| 116 | + Helper::log('Could not load parent document with UID '.$document->getCurrentDocument()->parentId, LOG_SEVERITY_ERROR); |
|
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -196,19 +196,19 @@ discard block |
||
| 196 | 196 | } catch (\Exception $e) { |
| 197 | 197 | if (!(Environment::isCli())) { |
| 198 | 198 | Helper::addMessage( |
| 199 | - Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), |
|
| 199 | + Helper::getLanguageService()->getLL('flash.solrException').' '.htmlspecialchars($e->getMessage()), |
|
| 200 | 200 | Helper::getLanguageService()->getLL('flash.error'), |
| 201 | 201 | FlashMessage::ERROR, |
| 202 | 202 | true, |
| 203 | 203 | 'core.template.flashMessages' |
| 204 | 204 | ); |
| 205 | 205 | } |
| 206 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 206 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 207 | 207 | return false; |
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - Helper::log('Document not deleted from SOLR - problem with the connection to the SOLR core ' . $solrCoreUid, LOG_SEVERITY_ERROR); |
|
| 211 | + Helper::log('Document not deleted from SOLR - problem with the connection to the SOLR core '.$solrCoreUid, LOG_SEVERITY_ERROR); |
|
| 212 | 212 | return false; |
| 213 | 213 | } |
| 214 | 214 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | // Sanitize input. |
| 230 | 230 | $pid = max((int) $pid, 0); |
| 231 | 231 | if (!$pid) { |
| 232 | - Helper::log('Invalid PID ' . $pid . ' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 232 | + Helper::log('Invalid PID '.$pid.' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 233 | 233 | return ''; |
| 234 | 234 | } |
| 235 | 235 | // Load metadata configuration. |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $suffix = (in_array($indexName, self::$fields['tokenized']) ? 't' : 'u'); |
| 239 | 239 | $suffix .= (in_array($indexName, self::$fields['stored']) ? 's' : 'u'); |
| 240 | 240 | $suffix .= (in_array($indexName, self::$fields['indexed']) ? 'i' : 'u'); |
| 241 | - $indexName .= '_' . $suffix; |
|
| 241 | + $indexName .= '_'.$suffix; |
|
| 242 | 242 | return $indexName; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $solrDoc->setField('title', $metadata['title'][0]); |
| 355 | 355 | $solrDoc->setField('volume', $metadata['volume'][0]); |
| 356 | 356 | // verify date formatting |
| 357 | - if(strtotime($metadata['date'][0])) { |
|
| 357 | + if (strtotime($metadata['date'][0])) { |
|
| 358 | 358 | $solrDoc->setField('date', self::getFormattedDate($metadata['date'][0])); |
| 359 | 359 | } |
| 360 | 360 | $solrDoc->setField('record_id', $metadata['record_id'][0]); |
@@ -517,11 +517,11 @@ discard block |
||
| 517 | 517 | $solrDoc->setField(self::getIndexFieldName($indexName, $document->getPid()), $data); |
| 518 | 518 | if (in_array($indexName, self::$fields['sortables'])) { |
| 519 | 519 | // Add sortable fields to index. |
| 520 | - $solrDoc->setField($indexName . '_sorting', $metadata[$indexName . '_sorting'][0]); |
|
| 520 | + $solrDoc->setField($indexName.'_sorting', $metadata[$indexName.'_sorting'][0]); |
|
| 521 | 521 | } |
| 522 | 522 | if (in_array($indexName, self::$fields['facets'])) { |
| 523 | 523 | // Add facets to index. |
| 524 | - $solrDoc->setField($indexName . '_faceting', $data); |
|
| 524 | + $solrDoc->setField($indexName.'_faceting', $data); |
|
| 525 | 525 | } |
| 526 | 526 | if (in_array($indexName, self::$fields['autocomplete'])) { |
| 527 | 527 | $autocomplete = array_merge($autocomplete, $data); |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $data = self::removeAppendsFromAuthor($data); |
| 558 | 558 | } |
| 559 | 559 | // Add facets to index. |
| 560 | - $solrDoc->setField($indexName . '_faceting', $data); |
|
| 560 | + $solrDoc->setField($indexName.'_faceting', $data); |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | // Add sorting information to physical sub-elements if applicable. |
@@ -587,9 +587,9 @@ discard block |
||
| 587 | 587 | $update = self::$solr->service->createUpdate(); |
| 588 | 588 | $query = ""; |
| 589 | 589 | if ($field == 'uid' || $field == 'partof') { |
| 590 | - $query = $field . ':' . $value; |
|
| 590 | + $query = $field.':'.$value; |
|
| 591 | 591 | } else { |
| 592 | - $query = $field . ':"' . $value . '"'; |
|
| 592 | + $query = $field.':"'.$value.'"'; |
|
| 593 | 593 | } |
| 594 | 594 | $update->addDeleteQuery($query); |
| 595 | 595 | $update->addCommit(); |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | { |
| 615 | 615 | $solrDoc = $updateQuery->createDocument(); |
| 616 | 616 | // Create unique identifier from document's UID and unit's XML ID. |
| 617 | - $solrDoc->setField('id', $document->getUid() . $unit['id']); |
|
| 617 | + $solrDoc->setField('id', $document->getUid().$unit['id']); |
|
| 618 | 618 | $solrDoc->setField('uid', $document->getUid()); |
| 619 | 619 | $solrDoc->setField('pid', $document->getPid()); |
| 620 | 620 | $solrDoc->setField('partof', $document->getPartof()); |
@@ -693,9 +693,9 @@ discard block |
||
| 693 | 693 | private static function handleException(string $errorMessage): void |
| 694 | 694 | { |
| 695 | 695 | if (!(Environment::isCli())) { |
| 696 | - self::addErrorMessage(Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($errorMessage)); |
|
| 696 | + self::addErrorMessage(Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($errorMessage)); |
|
| 697 | 697 | } |
| 698 | - Helper::log('Apache Solr threw exception: "' . $errorMessage . '"', LOG_SEVERITY_ERROR); |
|
| 698 | + Helper::log('Apache Solr threw exception: "'.$errorMessage.'"', LOG_SEVERITY_ERROR); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $file = $this->getFileInfo($id); |
| 190 | 190 | if ($file['mimeType'] === 'application/vnd.kitodo.iiif') { |
| 191 | - $file['location'] = (strrpos($file['location'], 'info.json') === strlen($file['location']) - 9) ? $file['location'] : (strrpos($file['location'], '/') === strlen($file['location']) ? $file['location'] . 'info.json' : $file['location'] . '/info.json'); |
|
| 191 | + $file['location'] = (strrpos($file['location'], 'info.json') === strlen($file['location']) - 9) ? $file['location'] : (strrpos($file['location'], '/') === strlen($file['location']) ? $file['location'].'info.json' : $file['location'].'/info.json'); |
|
| 192 | 192 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
| 193 | 193 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
| 194 | 194 | IiifHelper::setMaxThumbnailHeight($conf['thumbnailHeight']); |
@@ -198,9 +198,9 @@ discard block |
||
| 198 | 198 | return $service->getImageUrl(); |
| 199 | 199 | } |
| 200 | 200 | } elseif ($file['mimeType'] === 'application/vnd.netfpx') { |
| 201 | - $baseURL = $file['location'] . (strpos($file['location'], '?') === false ? '?' : ''); |
|
| 201 | + $baseURL = $file['location'].(strpos($file['location'], '?') === false ? '?' : ''); |
|
| 202 | 202 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
| 203 | - return $baseURL . '&CVT=jpeg'; |
|
| 203 | + return $baseURL.'&CVT=jpeg'; |
|
| 204 | 204 | } |
| 205 | 205 | return $file['location']; |
| 206 | 206 | } |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public function getFileLocation(string $id): string |
| 231 | 231 | { |
| 232 | - $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
| 232 | + $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'); |
|
| 233 | 233 | if ( |
| 234 | 234 | !empty($id) |
| 235 | 235 | && !empty($location) |
| 236 | 236 | ) { |
| 237 | 237 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
| 238 | 238 | } else { |
| 239 | - $this->logger->warning('There is no file node with @ID "' . $id . '"'); |
|
| 239 | + $this->logger->warning('There is no file node with @ID "'.$id.'"'); |
|
| 240 | 240 | return ''; |
| 241 | 241 | } |
| 242 | 242 | } |
@@ -246,14 +246,14 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function getFileMimeType(string $id): string |
| 248 | 248 | { |
| 249 | - $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE'); |
|
| 249 | + $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE'); |
|
| 250 | 250 | if ( |
| 251 | 251 | !empty($id) |
| 252 | 252 | && !empty($mimetype) |
| 253 | 253 | ) { |
| 254 | 254 | return (string) $mimetype[0]; |
| 255 | 255 | } else { |
| 256 | - $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified'); |
|
| 256 | + $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified'); |
|
| 257 | 257 | return ''; |
| 258 | 258 | } |
| 259 | 259 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | return $this->logicalUnits[$id]; |
| 274 | 274 | } elseif (!empty($id)) { |
| 275 | 275 | // Get specified logical unit. |
| 276 | - $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]'); |
|
| 276 | + $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); |
|
| 277 | 277 | } else { |
| 278 | 278 | // Get all logical units at top level. |
| 279 | 279 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $cPid = max($cPid, 0); |
| 462 | 462 | if ($cPid == 0 && ($this->cPid || $this->pid)) { |
| 463 | 463 | // Retain current PID. |
| 464 | - $cPid = $this->cPid ?: $this->pid; |
|
| 464 | + $cPid = $this->cPid ? : $this->pid; |
|
| 465 | 465 | } |
| 466 | 466 | return $cPid; |
| 467 | 467 | } |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | if (isset($this->fileInfos[$id]) || in_array('dmdSec', $metadataSections)) { |
| 529 | 529 | return $metadata; |
| 530 | 530 | } else { |
| 531 | - $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "' . $id . '"'); |
|
| 531 | + $this->logger->warning('No supported descriptive metadata found for logical structure with @ID "'.$id.'"'); |
|
| 532 | 532 | return []; |
| 533 | 533 | } |
| 534 | 534 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | if (!empty($this->logicalUnits[$id])) { |
| 548 | 548 | return [$this->logicalUnits[$id]['type']]; |
| 549 | 549 | } else { |
| 550 | - $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE'); |
|
| 550 | + $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
|
| 551 | 551 | if (!empty($struct)) { |
| 552 | 552 | return [(string) $struct[0]]; |
| 553 | 553 | } |
@@ -690,13 +690,13 @@ discard block |
||
| 690 | 690 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
| 691 | 691 | $values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode); |
| 692 | 692 | if ($values instanceof \DOMNodeList && $values->length > 0) { |
| 693 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
| 693 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
|
| 694 | 694 | } elseif (!($values instanceof \DOMNodeList)) { |
| 695 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values); |
|
| 695 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values); |
|
| 696 | 696 | } |
| 697 | 697 | } |
| 698 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
| 699 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 698 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
| 699 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | } |
@@ -756,11 +756,11 @@ discard block |
||
| 756 | 756 | return true; |
| 757 | 757 | } |
| 758 | 758 | } else { |
| 759 | - $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->mdSec[$dmdId]['type'] . '"'); |
|
| 759 | + $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->mdSec[$dmdId]['type'].'"'); |
|
| 760 | 760 | } |
| 761 | 761 | } |
| 762 | 762 | } else { |
| 763 | - $this->logger->notice('Unsupported metadata format "' . $this->mdSec[$dmdId]['type'] . '" in ' . $mdSectionType . ' with @ID "' . $dmdId . '"'); |
|
| 763 | + $this->logger->notice('Unsupported metadata format "'.$this->mdSec[$dmdId]['type'].'" in '.$mdSectionType.' with @ID "'.$dmdId.'"'); |
|
| 764 | 764 | } |
| 765 | 765 | return false; |
| 766 | 766 | } |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | $dmdIds = $this->logicalUnits[$id]['dmdId'] ?? ''; |
| 868 | 868 | $admIds = $this->logicalUnits[$id]['admId'] ?? ''; |
| 869 | 869 | } else { |
| 870 | - $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]')[0]; |
|
| 870 | + $mdSec = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]')[0]; |
|
| 871 | 871 | if ($mdSec) { |
| 872 | 872 | $dmdIds = (string) $mdSec->attributes()->DMDID; |
| 873 | 873 | $admIds = (string) $mdSec->attributes()->ADMID; |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | |
| 898 | 898 | return array_filter( |
| 899 | 899 | $allMdIds, |
| 900 | - function ($element) { |
|
| 900 | + function($element) { |
|
| 901 | 901 | return !empty($element); |
| 902 | 902 | } |
| 903 | 903 | ); |
@@ -923,7 +923,7 @@ discard block |
||
| 923 | 923 | */ |
| 924 | 924 | public function getStructureDepth(string $logId) |
| 925 | 925 | { |
| 926 | - $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*'); |
|
| 926 | + $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'); |
|
| 927 | 927 | if (!empty($ancestors)) { |
| 928 | 928 | return count($ancestors); |
| 929 | 929 | } else { |
@@ -947,9 +947,9 @@ discard block |
||
| 947 | 947 | $this->registerNamespaces($this->mets); |
| 948 | 948 | } else { |
| 949 | 949 | if (!empty($location)) { |
| 950 | - $this->logger->error('No METS part found in document with location "' . $location . '".'); |
|
| 950 | + $this->logger->error('No METS part found in document with location "'.$location.'".'); |
|
| 951 | 951 | } elseif (!empty($this->recordId)) { |
| 952 | - $this->logger->error('No METS part found in document with recordId "' . $this->recordId . '".'); |
|
| 952 | + $this->logger->error('No METS part found in document with recordId "'.$this->recordId.'".'); |
|
| 953 | 953 | } else { |
| 954 | 954 | $this->logger->error('No METS part found in current document.'); |
| 955 | 955 | } |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | return true; |
| 971 | 971 | } |
| 972 | 972 | } |
| 973 | - $this->logger->error('Could not load XML file from "' . $location . '"'); |
|
| 973 | + $this->logger->error('Could not load XML file from "'.$location.'"'); |
|
| 974 | 974 | return false; |
| 975 | 975 | } |
| 976 | 976 | |
@@ -1093,10 +1093,10 @@ discard block |
||
| 1093 | 1093 | |
| 1094 | 1094 | if (!empty($mdType) && !empty($this->formats[(string) $mdType[0]])) { |
| 1095 | 1095 | $type = (string) $mdType[0]; |
| 1096 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
| 1096 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
| 1097 | 1097 | } elseif (!empty($otherMdType) && !empty($this->formats[(string) $otherMdType[0]])) { |
| 1098 | 1098 | $type = (string) $otherMdType[0]; |
| 1099 | - $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']); |
|
| 1099 | + $xml = $element->xpath('./mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
|
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | if (empty($xml)) { |
@@ -1289,9 +1289,9 @@ discard block |
||
| 1289 | 1289 | || $forceReload |
| 1290 | 1290 | ) { |
| 1291 | 1291 | // Retain current PID. |
| 1292 | - $cPid = $this->cPid ?: $this->pid; |
|
| 1292 | + $cPid = $this->cPid ? : $this->pid; |
|
| 1293 | 1293 | if (!$cPid) { |
| 1294 | - $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
|
| 1294 | + $this->logger->error('Invalid PID '.$cPid.' for structure definitions'); |
|
| 1295 | 1295 | $this->thumbnailLoaded = true; |
| 1296 | 1296 | return $this->thumbnail; |
| 1297 | 1297 | } |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | if (!empty($resArray['thumbnail'])) { |
| 1329 | 1329 | $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid); |
| 1330 | 1330 | // Check if this document has a structure element of the desired type. |
| 1331 | - $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID'); |
|
| 1331 | + $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID'); |
|
| 1332 | 1332 | if (!empty($strctIds)) { |
| 1333 | 1333 | $strctId = (string) $strctIds[0]; |
| 1334 | 1334 | } |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | } |
| 1352 | 1352 | } |
| 1353 | 1353 | } else { |
| 1354 | - $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
|
| 1354 | + $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database'); |
|
| 1355 | 1355 | } |
| 1356 | 1356 | $this->thumbnailLoaded = true; |
| 1357 | 1357 | } |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | { |
| 1398 | 1398 | if (empty($this->parentHref)) { |
| 1399 | 1399 | // Get the closest ancestor of the current document which has a MPTR child. |
| 1400 | - $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->toplevelId . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
| 1400 | + $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->toplevelId.'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
| 1401 | 1401 | if (!empty($parentMptr)) { |
| 1402 | 1402 | $this->parentHref = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
| 1403 | 1403 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $this->initializeRepositories((int) $input->getOption('pid')); |
| 115 | 115 | |
| 116 | 116 | if ($this->storagePid == 0) { |
| 117 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
| 117 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
| 118 | 118 | return BaseCommand::FAILURE; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -129,13 +129,13 @@ discard block |
||
| 129 | 129 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 130 | 130 | $outputSolrCores = []; |
| 131 | 131 | foreach ($allSolrCores as $indexName => $uid) { |
| 132 | - $outputSolrCores[] = $uid . ' : ' . $indexName; |
|
| 132 | + $outputSolrCores[] = $uid.' : '.$indexName; |
|
| 133 | 133 | } |
| 134 | 134 | if (empty($outputSolrCores)) { |
| 135 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
| 135 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
| 136 | 136 | return BaseCommand::FAILURE; |
| 137 | 137 | } else { |
| 138 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $outputSolrCores) . "\n"); |
|
| 138 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $outputSolrCores)."\n"); |
|
| 139 | 139 | return BaseCommand::FAILURE; |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | ->setLimit((int) $input->getOption('index-limit')) |
| 166 | 166 | ->setOffset((int) $input->getOption('index-begin')) |
| 167 | 167 | ->execute(); |
| 168 | - $io->writeln($input->getOption('index-limit') . ' documents starting from ' . $input->getOption('index-begin') . ' will be indexed.'); |
|
| 168 | + $io->writeln($input->getOption('index-limit').' documents starting from '.$input->getOption('index-begin').' will be indexed.'); |
|
| 169 | 169 | } else { |
| 170 | 170 | // Get all documents. |
| 171 | 171 | $documents = $this->documentRepository->findAll(); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | ) { |
| 188 | 188 | $documents = $this->documentRepository->findAllByCollectionsLimited($collections, (int) $input->getOption('index-limit'), (int) $input->getOption('index-begin')); |
| 189 | 189 | |
| 190 | - $io->writeln($input->getOption('index-limit') . ' documents starting from ' . $input->getOption('index-begin') . ' will be indexed.'); |
|
| 190 | + $io->writeln($input->getOption('index-limit').' documents starting from '.$input->getOption('index-begin').' will be indexed.'); |
|
| 191 | 191 | } else { |
| 192 | 192 | // Get all documents of given collections. |
| 193 | 193 | $documents = $this->documentRepository->findAllByCollectionsLimited($collections, 0); |
@@ -201,15 +201,15 @@ discard block |
||
| 201 | 201 | $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true); |
| 202 | 202 | |
| 203 | 203 | if ($doc === null) { |
| 204 | - $io->warning('WARNING: Document "' . $document->getLocation() . '" could not be loaded. Skip to next document.'); |
|
| 204 | + $io->warning('WARNING: Document "'.$document->getLocation().'" could not be loaded. Skip to next document.'); |
|
| 205 | 205 | continue; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | if ($dryRun) { |
| 209 | - $io->writeln('DRY RUN: Would index ' . ($id + 1) . '/' . count($documents) . ' with UID "' . $document->getUid() . '" ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 209 | + $io->writeln('DRY RUN: Would index '.($id + 1).'/'.count($documents).' with UID "'.$document->getUid().'" ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 210 | 210 | } else { |
| 211 | 211 | if ($io->isVerbose()) { |
| 212 | - $io->writeln(date('Y-m-d H:i:s') . ' Indexing ' . ($id + 1) . '/' . count($documents) . ' with UID "' . $document->getUid() . '" ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 212 | + $io->writeln(date('Y-m-d H:i:s').' Indexing '.($id + 1).'/'.count($documents).' with UID "'.$document->getUid().'" ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 213 | 213 | } |
| 214 | 214 | $document->setCurrentDocument($doc); |
| 215 | 215 | // save to database |