@@ -126,8 +126,8 @@ |
||
| 126 | 126 | ->select(...explode(',', $fields)) |
| 127 | 127 | ->from($table) |
| 128 | 128 | ->where( |
| 129 | - $queryBuilder->expr()->eq($table . '.pid', intval($this->storagePid)), |
|
| 130 | - $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), |
|
| 129 | + $queryBuilder->expr()->eq($table.'.pid', intval($this->storagePid)), |
|
| 130 | + $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]), |
|
| 131 | 131 | $andWhere |
| 132 | 132 | ) |
| 133 | 133 | ->orderBy($sorting) |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | // parameters are available in $this->data['parameterArray']['fieldConf']['config']['parameters'] |
| 23 | 23 | $result = $this->initializeResultArray(); |
| 24 | 24 | if (!empty($this->data['databaseRow']['thumbnail'])) { |
| 25 | - $result['html'] = '<img alt="Thumbnail" title="" src="' . $this->data['databaseRow']['thumbnail'] . '" />'; |
|
| 25 | + $result['html'] = '<img alt="Thumbnail" title="" src="'.$this->data['databaseRow']['thumbnail'].'" />'; |
|
| 26 | 26 | } else { |
| 27 | 27 | $result['html'] = ''; |
| 28 | 28 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | // order by oai_name |
| 49 | 49 | $query->setOrderings( |
| 50 | - array('sorting' => QueryInterface::ORDER_ASCENDING) |
|
| 50 | + array ('sorting' => QueryInterface::ORDER_ASCENDING) |
|
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | return $query->execute(); |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | |
| 99 | 99 | // order by oai_name |
| 100 | 100 | $query->setOrderings( |
| 101 | - array('oai_name' => QueryInterface::ORDER_ASCENDING) |
|
| 101 | + array ('oai_name' => QueryInterface::ORDER_ASCENDING) |
|
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | return $query->execute(); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if ($this->document) { |
| 158 | 158 | $doc = Doc::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
| 159 | 159 | } else { |
| 160 | - $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
|
| 160 | + $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$pid.'" for document loading'); |
|
| 161 | 161 | } |
| 162 | 162 | } else if (GeneralUtility::isValidUrl($requestData['id'])) { |
| 163 | 163 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | $this->document->setLocation($requestData['id']); |
| 177 | 177 | } else { |
| 178 | - $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading'); |
|
| 178 | + $this->logger->error('Invalid location given "'.$requestData['id'].'" for document loading'); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | if ($this->document !== null && $doc !== null) { |
| 193 | 193 | $this->document->setDoc($doc); |
| 194 | 194 | } else { |
| 195 | - $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |
|
| 195 | + $this->logger->error('Failed to load document with record ID "'.$requestData['recordId'].'"'); |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | } else { |
| 199 | - $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
|
| 199 | + $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$pid.'" for document loading'); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | // Get next available core name if none given. |
| 136 | 136 | if (empty($core)) { |
| 137 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
| 137 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
| 138 | 138 | } |
| 139 | 139 | // Get Solr service instance. |
| 140 | 140 | $solr = self::getInstance($core); |
@@ -230,13 +230,13 @@ discard block |
||
| 230 | 230 | ->execute(); |
| 231 | 231 | |
| 232 | 232 | while ($resArray = $result->fetch()) { |
| 233 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
| 233 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // Check if queried field is valid. |
| 237 | 237 | $splitQuery = explode(':', $query, 2); |
| 238 | 238 | if (in_array($splitQuery[0], $fields)) { |
| 239 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
| 239 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
| 240 | 240 | } else { |
| 241 | 241 | $query = self::escapeQuery($query); |
| 242 | 242 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | { |
| 342 | 342 | $number = max(intval($number), 0); |
| 343 | 343 | // Check if core already exists. |
| 344 | - $solr = self::getInstance('dlfCore' . $number); |
|
| 344 | + $solr = self::getInstance('dlfCore'.$number); |
|
| 345 | 345 | if (!$solr->ready) { |
| 346 | 346 | return $number; |
| 347 | 347 | } else { |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $parameters['start'] = 0; |
| 404 | 404 | $parameters['rows'] = $this->limit; |
| 405 | 405 | // Calculate cache identifier. |
| 406 | - $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true)); |
|
| 406 | + $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true)); |
|
| 407 | 407 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 408 | 408 | $resultSet = []; |
| 409 | 409 | if (($entry = $cache->get($cacheIdentifier)) === false) { |
@@ -534,12 +534,12 @@ discard block |
||
| 534 | 534 | */ |
| 535 | 535 | public function __get($var) |
| 536 | 536 | { |
| 537 | - $method = '_get' . ucfirst($var); |
|
| 537 | + $method = '_get'.ucfirst($var); |
|
| 538 | 538 | if ( |
| 539 | 539 | !property_exists($this, $var) |
| 540 | 540 | || !method_exists($this, $method) |
| 541 | 541 | ) { |
| 542 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
| 542 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
| 543 | 543 | return; |
| 544 | 544 | } else { |
| 545 | 545 | return $this->$method(); |
@@ -572,12 +572,12 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | public function __set($var, $value) |
| 574 | 574 | { |
| 575 | - $method = '_set' . ucfirst($var); |
|
| 575 | + $method = '_set'.ucfirst($var); |
|
| 576 | 576 | if ( |
| 577 | 577 | !property_exists($this, $var) |
| 578 | 578 | || !method_exists($this, $method) |
| 579 | 579 | ) { |
| 580 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
| 580 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
| 581 | 581 | } else { |
| 582 | 582 | $this->$method($value); |
| 583 | 583 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | 'scheme' => $this->config['scheme'], |
| 615 | 615 | 'host' => $this->config['host'], |
| 616 | 616 | 'port' => $this->config['port'], |
| 617 | - 'path' => '/' . $this->config['path'], |
|
| 617 | + 'path' => '/'.$this->config['path'], |
|
| 618 | 618 | 'core' => $core, |
| 619 | 619 | 'username' => $this->config['username'], |
| 620 | 620 | 'password' => $this->config['password'], |
@@ -569,14 +569,14 @@ discard block |
||
| 569 | 569 | if ($fileContent !== false) { |
| 570 | 570 | $textFormat = $this->getTextFormat($fileContent); |
| 571 | 571 | } else { |
| 572 | - $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"'); |
|
| 572 | + $this->logger->warning('Couldn\'t load full text file for structure node @ID "'.$id.'"'); |
|
| 573 | 573 | return $fullText; |
| 574 | 574 | } |
| 575 | 575 | break; |
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | } else { |
| 579 | - $this->logger->warning('Invalid structure node @ID "' . $id . '"'); |
|
| 579 | + $this->logger->warning('Invalid structure node @ID "'.$id.'"'); |
|
| 580 | 580 | return $fullText; |
| 581 | 581 | } |
| 582 | 582 | // Is this text format supported? |
@@ -595,12 +595,12 @@ discard block |
||
| 595 | 595 | $textMiniOcr = $obj->getTextAsMiniOcr($ocrTextXml); |
| 596 | 596 | $this->rawTextArray[$id] = $textMiniOcr; |
| 597 | 597 | } else { |
| 598 | - $this->logger->warning('Invalid class/method "' . $class . '->getRawText()" for text format "' . $textFormat . '"'); |
|
| 598 | + $this->logger->warning('Invalid class/method "'.$class.'->getRawText()" for text format "'.$textFormat.'"'); |
|
| 599 | 599 | } |
| 600 | 600 | } |
| 601 | 601 | $fullText = $textMiniOcr; |
| 602 | 602 | } else { |
| 603 | - $this->logger->warning('Unsupported text format "' . $textFormat . '" in physical node with @ID "' . $id . '"'); |
|
| 603 | + $this->logger->warning('Unsupported text format "'.$textFormat.'" in physical node with @ID "'.$id.'"'); |
|
| 604 | 604 | } |
| 605 | 605 | return $fullText; |
| 606 | 606 | } |
@@ -674,10 +674,10 @@ discard block |
||
| 674 | 674 | $title = self::getTitle($partof, true); |
| 675 | 675 | } |
| 676 | 676 | } else { |
| 677 | - Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING); |
|
| 677 | + Helper::log('No document with UID '.$uid.' found or document not accessible', LOG_SEVERITY_WARNING); |
|
| 678 | 678 | } |
| 679 | 679 | } else { |
| 680 | - Helper::log('Invalid UID ' . $uid . ' for document', LOG_SEVERITY_ERROR); |
|
| 680 | + Helper::log('Invalid UID '.$uid.' for document', LOG_SEVERITY_ERROR); |
|
| 681 | 681 | } |
| 682 | 682 | return $title; |
| 683 | 683 | } |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | // the actual loading is format specific |
| 809 | 809 | return $this->loadLocation($location); |
| 810 | 810 | } else { |
| 811 | - $this->logger->error('Invalid file location "' . $location . '" for document loading'); |
|
| 811 | + $this->logger->error('Invalid file location "'.$location.'" for document loading'); |
|
| 812 | 812 | } |
| 813 | 813 | return false; |
| 814 | 814 | } |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | // Set metadata definitions' PID. |
| 950 | 950 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
| 951 | 951 | if (!$cPid) { |
| 952 | - $this->logger->error('Invalid PID ' . $cPid . ' for metadata definitions'); |
|
| 952 | + $this->logger->error('Invalid PID '.$cPid.' for metadata definitions'); |
|
| 953 | 953 | return []; |
| 954 | 954 | } |
| 955 | 955 | if ( |
@@ -1184,12 +1184,12 @@ discard block |
||
| 1184 | 1184 | */ |
| 1185 | 1185 | public function __get($var) |
| 1186 | 1186 | { |
| 1187 | - $method = '_get' . ucfirst($var); |
|
| 1187 | + $method = '_get'.ucfirst($var); |
|
| 1188 | 1188 | if ( |
| 1189 | 1189 | !property_exists($this, $var) |
| 1190 | 1190 | || !method_exists($this, $method) |
| 1191 | 1191 | ) { |
| 1192 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
| 1192 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
| 1193 | 1193 | return; |
| 1194 | 1194 | } else { |
| 1195 | 1195 | return $this->$method(); |
@@ -1222,12 +1222,12 @@ discard block |
||
| 1222 | 1222 | */ |
| 1223 | 1223 | public function __set($var, $value) |
| 1224 | 1224 | { |
| 1225 | - $method = '_set' . ucfirst($var); |
|
| 1225 | + $method = '_set'.ucfirst($var); |
|
| 1226 | 1226 | if ( |
| 1227 | 1227 | !property_exists($this, $var) |
| 1228 | 1228 | || !method_exists($this, $method) |
| 1229 | 1229 | ) { |
| 1230 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
| 1230 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
| 1231 | 1231 | } else { |
| 1232 | 1232 | $this->$method($value); |
| 1233 | 1233 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->initializeRepositories($input->getOption('pid')); |
| 97 | 97 | |
| 98 | 98 | if ($this->storagePid == 0) { |
| 99 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
| 99 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
| 100 | 100 | exit(1); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 112 | 112 | $output_solrCores = []; |
| 113 | 113 | foreach ($allSolrCores as $index_name => $uid) { |
| 114 | - $output_solrCores[] = $uid . ' : ' . $index_name; |
|
| 114 | + $output_solrCores[] = $uid.' : '.$index_name; |
|
| 115 | 115 | } |
| 116 | 116 | if (empty($output_solrCores)) { |
| 117 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
| 117 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
| 118 | 118 | exit(1); |
| 119 | 119 | } else { |
| 120 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n"); |
|
| 120 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n"); |
|
| 121 | 121 | exit(1); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $document = $this->documentRepository->findByUid($input->getOption('doc')); |
| 158 | 158 | |
| 159 | 159 | if ($document === null) { |
| 160 | - $io->error('ERROR: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . ' .'); |
|
| 160 | + $io->error('ERROR: Document with UID "'.$input->getOption('doc').'" could not be found on PID '.$this->storagePid.' .'); |
|
| 161 | 161 | exit(1); |
| 162 | 162 | } else { |
| 163 | 163 | $doc = Doc::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true); |
@@ -182,17 +182,17 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if ($doc === null) { |
| 185 | - $io->error('ERROR: Document "' . $input->getOption('doc') . '" could not be loaded.'); |
|
| 185 | + $io->error('ERROR: Document "'.$input->getOption('doc').'" could not be loaded.'); |
|
| 186 | 186 | exit(1); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | $document->setSolrcore($solrCoreUid); |
| 190 | 190 | |
| 191 | 191 | if ($dryRun) { |
| 192 | - $io->section('DRY RUN: Would index ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 192 | + $io->section('DRY RUN: Would index '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 193 | 193 | } else { |
| 194 | 194 | if ($io->isVerbose()) { |
| 195 | - $io->section('Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 195 | + $io->section('Indexing '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 196 | 196 | } |
| 197 | 197 | $document->setDoc($doc); |
| 198 | 198 | // save to database |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $this->initializeRepositories($input->getOption('pid')); |
| 101 | 101 | |
| 102 | 102 | if ($this->storagePid == 0) { |
| 103 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
| 103 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
| 104 | 104 | exit(1); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 116 | 116 | $output_solrCores = []; |
| 117 | 117 | foreach ($allSolrCores as $index_name => $uid) { |
| 118 | - $output_solrCores[] = $uid . ' : ' . $index_name; |
|
| 118 | + $output_solrCores[] = $uid.' : '.$index_name; |
|
| 119 | 119 | } |
| 120 | 120 | if (empty($output_solrCores)) { |
| 121 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
| 121 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
| 122 | 122 | exit(1); |
| 123 | 123 | } else { |
| 124 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n"); |
|
| 124 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n"); |
|
| 125 | 125 | exit(1); |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -163,15 +163,15 @@ discard block |
||
| 163 | 163 | $doc = Doc::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true); |
| 164 | 164 | |
| 165 | 165 | if ($doc === null) { |
| 166 | - $io->warning('WARNING: Document "' . $document->getLocation() . '" could not be loaded. Skip to next document.'); |
|
| 166 | + $io->warning('WARNING: Document "'.$document->getLocation().'" could not be loaded. Skip to next document.'); |
|
| 167 | 167 | continue; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | if ($dryRun) { |
| 171 | - $io->writeln('DRY RUN: Would index ' . ($id + 1) . '/' . count($documents) . ' with UID "' . $document->getUid() . '" ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 171 | + $io->writeln('DRY RUN: Would index '.($id + 1).'/'.count($documents).' with UID "'.$document->getUid().'" ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 172 | 172 | } else { |
| 173 | 173 | if ($io->isVerbose()) { |
| 174 | - $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 . '.'); |
|
| 174 | + $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.'.'); |
|
| 175 | 175 | } |
| 176 | 176 | $document->setDoc($doc); |
| 177 | 177 | // save to database |