@@ -274,7 +274,7 @@ |
||
| 274 | 274 | |
| 275 | 275 | if ($doc !== null) { |
| 276 | 276 | // Get the closest ancestor of the current document which has a MPTR child. |
| 277 | - $parentMptr = $doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $doc->toplevelId . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
| 277 | + $parentMptr = $doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$doc->toplevelId.'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr'); |
|
| 278 | 278 | if (!empty($parentMptr)) { |
| 279 | 279 | $parentLocation = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
| 280 | 280 | |
@@ -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 |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $this->initializeRepositories($input->getOption('pid')); |
| 111 | 111 | |
| 112 | 112 | if ($this->storagePid == 0) { |
| 113 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
| 113 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
| 114 | 114 | exit(1); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 129 | 129 | $output_solrCores = []; |
| 130 | 130 | foreach ($allSolrCores as $index_name => $uid) { |
| 131 | - $output_solrCores[] = $uid . ' : ' . $index_name; |
|
| 131 | + $output_solrCores[] = $uid.' : '.$index_name; |
|
| 132 | 132 | } |
| 133 | 133 | if (empty($output_solrCores)) { |
| 134 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
| 134 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
| 135 | 135 | exit(1); |
| 136 | 136 | } else { |
| 137 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n"); |
|
| 137 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n"); |
|
| 138 | 138 | exit(1); |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | exit(1); |
| 155 | 155 | } |
| 156 | 156 | if (!GeneralUtility::isValidUrl($baseUrl)) { |
| 157 | - $io->error('ERROR: No valid OAI Base URL set for library with given UID ("' . $input->getOption('lib') . '").'); |
|
| 157 | + $io->error('ERROR: No valid OAI Base URL set for library with given UID ("'.$input->getOption('lib').'").'); |
|
| 158 | 158 | exit(1); |
| 159 | 159 | } else { |
| 160 | 160 | try { |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | if (empty($set)) { |
| 198 | - $io->error('ERROR: OAI interface does not provide a set with given setSpec ("' . $input->getOption('set') . '").'); |
|
| 198 | + $io->error('ERROR: OAI interface does not provide a set with given setSpec ("'.$input->getOption('set').'").'); |
|
| 199 | 199 | exit(1); |
| 200 | 200 | } |
| 201 | 201 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | // Process all identifiers. |
| 211 | - $baseLocation = $baseUrl . (parse_url($baseUrl, PHP_URL_QUERY) ? '&' : '?'); |
|
| 211 | + $baseLocation = $baseUrl.(parse_url($baseUrl, PHP_URL_QUERY) ? '&' : '?'); |
|
| 212 | 212 | foreach ($identifiers as $identifier) { |
| 213 | 213 | // Build OAI GetRecord URL... |
| 214 | 214 | $params = [ |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | 'metadataPrefix' => 'mets', |
| 217 | 217 | 'identifier' => (string) $identifier->identifier |
| 218 | 218 | ]; |
| 219 | - $docLocation = $baseLocation . http_build_query($params); |
|
| 219 | + $docLocation = $baseLocation.http_build_query($params); |
|
| 220 | 220 | // ...index the document... |
| 221 | 221 | $document = null; |
| 222 | 222 | $doc = Doc::getInstance($docLocation, ['storagePid' => $this->storagePid], true); |
| 223 | 223 | |
| 224 | 224 | if ($doc === null) { |
| 225 | - $io->warning('WARNING: Document "' . $docLocation . '" could not be loaded. Skip to next document.'); |
|
| 225 | + $io->warning('WARNING: Document "'.$docLocation.'" could not be loaded. Skip to next document.'); |
|
| 226 | 226 | continue; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $document->setSolrcore($solrCoreUid); |
| 240 | 240 | |
| 241 | 241 | if ($dryRun) { |
| 242 | - $io->writeln('DRY RUN: Would index ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 242 | + $io->writeln('DRY RUN: Would index '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 243 | 243 | } else { |
| 244 | 244 | if ($io->isVerbose()) { |
| 245 | - $io->writeln(date('Y-m-d H:i:s') . ' Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.'); |
|
| 245 | + $io->writeln(date('Y-m-d H:i:s').' Indexing '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.'); |
|
| 246 | 246 | } |
| 247 | 247 | $document->setDoc($doc); |
| 248 | 248 | // save to database |
@@ -267,6 +267,6 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io) |
| 269 | 269 | { |
| 270 | - $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:' . "\n " . $exception->getMessage()); |
|
| 270 | + $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:'."\n ".$exception->getMessage()); |
|
| 271 | 271 | } |
| 272 | 272 | } |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getDescription(): string |
| 56 | 56 | { |
| 57 | - return 'This wizard migrates existing front end plugins of the extension Kitodo.Presentation (dlf) to' . |
|
| 58 | - ' make use of the Extbase naming scheme. Therefore it updates the field values' . |
|
| 57 | + return 'This wizard migrates existing front end plugins of the extension Kitodo.Presentation (dlf) to'. |
|
| 58 | + ' make use of the Extbase naming scheme. Therefore it updates the field values'. |
|
| 59 | 59 | ' "pi_flexform" within the tt_content table'; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | foreach ($fields as $field) { |
| 171 | 171 | // change the index attribute if it doesn't start with 'settings.' yet |
| 172 | 172 | if (strpos($field['index'], 'settings.') === false) { |
| 173 | - $field['index'] = 'settings.' . $field['index']; |
|
| 173 | + $field['index'] = 'settings.'.$field['index']; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | $queryBuilder->createNamedParameter('', \PDO::PARAM_STR) |
| 173 | 173 | ), |
| 174 | 174 | $queryBuilder->expr()->comparison( |
| 175 | - 'CAST(CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS DECIMAL) AS CHAR)', |
|
| 175 | + 'CAST(CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS DECIMAL) AS CHAR)', |
|
| 176 | 176 | ExpressionBuilder::NEQ, |
| 177 | - 'CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS CHAR)' |
|
| 177 | + 'CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS CHAR)' |
|
| 178 | 178 | ) |
| 179 | 179 | ) |
| 180 | 180 | ->orderBy('uid') |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } catch (DBALException $e) { |
| 189 | 189 | throw new \RuntimeException( |
| 190 | - 'Database query failed. Error was: ' . $e->getPrevious()->getMessage(), |
|
| 190 | + 'Database query failed. Error was: '.$e->getPrevious()->getMessage(), |
|
| 191 | 191 | 1511950673 |
| 192 | 192 | ); |
| 193 | 193 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
| 247 | 247 | |
| 248 | 248 | $fileUid = null; |
| 249 | - $sourcePath = Environment::getPublicPath() . '/' . $fieldItem; |
|
| 249 | + $sourcePath = Environment::getPublicPath().'/'.$fieldItem; |
|
| 250 | 250 | |
| 251 | 251 | // maybe the file was already moved, so check if the original file still exists |
| 252 | 252 | if (file_exists($sourcePath)) { |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $parent->setDoc($doc); |
| 116 | 116 | $success = self::add($parent); |
| 117 | 117 | } else { |
| 118 | - Helper::log('Could not load parent document with UID ' . $document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
| 118 | + Helper::log('Could not load parent document with UID '.$document->getDoc()->parentId, LOG_SEVERITY_ERROR); |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | self::$processedDocs[] = $document->getUid(); |
| 126 | 126 | // Delete old Solr documents. |
| 127 | 127 | $updateQuery = self::$solr->service->createUpdate(); |
| 128 | - $updateQuery->addDeleteQuery('uid:' . $document->getUid()); |
|
| 128 | + $updateQuery->addDeleteQuery('uid:'.$document->getUid()); |
|
| 129 | 129 | self::$solr->service->update($updateQuery); |
| 130 | 130 | |
| 131 | 131 | // Index every logical unit as separate Solr document. |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | } catch (\Exception $e) { |
| 175 | 175 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 176 | 176 | Helper::addMessage( |
| 177 | - Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), |
|
| 177 | + Helper::getLanguageService()->getLL('flash.solrException').' '.htmlspecialchars($e->getMessage()), |
|
| 178 | 178 | Helper::getLanguageService()->getLL('flash.error'), |
| 179 | 179 | FlashMessage::ERROR, |
| 180 | 180 | true, |
| 181 | 181 | 'core.template.flashMessages' |
| 182 | 182 | ); |
| 183 | 183 | } |
| 184 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 184 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 185 | 185 | return false; |
| 186 | 186 | } |
| 187 | 187 | } else { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | // Sanitize input. |
| 215 | 215 | $pid = max(intval($pid), 0); |
| 216 | 216 | if (!$pid) { |
| 217 | - Helper::log('Invalid PID ' . $pid . ' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 217 | + Helper::log('Invalid PID '.$pid.' for metadata configuration', LOG_SEVERITY_ERROR); |
|
| 218 | 218 | return ''; |
| 219 | 219 | } |
| 220 | 220 | // Load metadata configuration. |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
| 224 | 224 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
| 225 | 225 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
| 226 | - $index_name .= '_' . $suffix; |
|
| 226 | + $index_name .= '_'.$suffix; |
|
| 227 | 227 | return $index_name; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -356,11 +356,11 @@ discard block |
||
| 356 | 356 | $solrDoc->setField(self::getIndexFieldName($index_name, $document->getPid()), $data, self::$fields['fieldboost'][$index_name]); |
| 357 | 357 | if (in_array($index_name, self::$fields['sortables'])) { |
| 358 | 358 | // Add sortable fields to index. |
| 359 | - $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]); |
|
| 359 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 360 | 360 | } |
| 361 | 361 | if (in_array($index_name, self::$fields['facets'])) { |
| 362 | 362 | // Add facets to index. |
| 363 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 363 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 364 | 364 | } |
| 365 | 365 | if (in_array($index_name, self::$fields['autocomplete'])) { |
| 366 | 366 | $autocomplete = array_merge($autocomplete, $data); |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | } catch (\Exception $e) { |
| 386 | 386 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 387 | 387 | Helper::addMessage( |
| 388 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 388 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
| 389 | 389 | Helper::getLanguageService()->getLL('flash.error'), |
| 390 | 390 | FlashMessage::ERROR, |
| 391 | 391 | true, |
| 392 | 392 | 'core.template.flashMessages' |
| 393 | 393 | ); |
| 394 | 394 | } |
| 395 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 395 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 396 | 396 | return false; |
| 397 | 397 | } |
| 398 | 398 | } |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $data = self::removeAppendsFromAuthor($data); |
| 459 | 459 | } |
| 460 | 460 | // Add facets to index. |
| 461 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 461 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -476,14 +476,14 @@ discard block |
||
| 476 | 476 | } catch (\Exception $e) { |
| 477 | 477 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 478 | 478 | Helper::addMessage( |
| 479 | - Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 479 | + Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()), |
|
| 480 | 480 | Helper::getLanguageService()->getLL('flash.error'), |
| 481 | 481 | FlashMessage::ERROR, |
| 482 | 482 | true, |
| 483 | 483 | 'core.template.flashMessages' |
| 484 | 484 | ); |
| 485 | 485 | } |
| 486 | - Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR); |
|
| 486 | + Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR); |
|
| 487 | 487 | return false; |
| 488 | 488 | } |
| 489 | 489 | } |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') { |
| 535 | 535 | $solrDoc = $updateQuery->createDocument(); |
| 536 | 536 | // Create unique identifier from document's UID and unit's XML ID. |
| 537 | - $solrDoc->setField('id', $document->getUid() . $unit['id']); |
|
| 537 | + $solrDoc->setField('id', $document->getUid().$unit['id']); |
|
| 538 | 538 | $solrDoc->setField('uid', $document->getUid()); |
| 539 | 539 | $solrDoc->setField('pid', $document->getPid()); |
| 540 | 540 | $solrDoc->setField('partof', $document->getPartof()); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
| 163 | 163 | if ($this->settings['suggest']) { |
| 164 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 164 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $this->view->assign('viewData', $this->viewData); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | // Get facets from plugin configuration. |
| 185 | 185 | $facets = []; |
| 186 | 186 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
| 187 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 187 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -226,13 +226,13 @@ discard block |
||
| 226 | 226 | $searchParams = $this->searchParams; |
| 227 | 227 | if ( |
| 228 | 228 | (!empty($searchParams['fulltext'])) |
| 229 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 229 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 230 | 230 | ) { |
| 231 | 231 | // If the query already is a fulltext query e.g using the facets |
| 232 | 232 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 233 | 233 | // Search in fulltext field if applicable. Query must not be empty! |
| 234 | 234 | if (!empty($this->searchParams['query'])) { |
| 235 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 235 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 236 | 236 | } |
| 237 | 237 | } else { |
| 238 | 238 | // Retain given search field if valid. |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 257 | 257 | ) { |
| 258 | 258 | if (!empty($search['query'])) { |
| 259 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 259 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 260 | 260 | } |
| 261 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 261 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | } |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $entryArray['doNotLinkIt'] = 0; |
| 384 | 384 | // Check if facet is already selected. |
| 385 | 385 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
| 386 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
| 386 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
| 387 | 387 | if ($index !== false) { |
| 388 | 388 | // Facet is selected, thus remove it from filter. |
| 389 | 389 | unset($queryColumn[$index]); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | } |
| 398 | 398 | } else { |
| 399 | 399 | // Facet is not selected, thus add it to filter. |
| 400 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
| 400 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
| 401 | 401 | $entryArray['ITEM_STATE'] = 'NO'; |
| 402 | 402 | } |
| 403 | 403 | $entryArray['queryColumn'] = $queryColumn; |
@@ -15,10 +15,10 @@ |
||
| 15 | 15 | preg_match("@.*/(?:acceptance|functional-[a-z0-9]+)@", $_SERVER['REQUEST_URI'], $matches); |
| 16 | 16 | |
| 17 | 17 | if (!empty($matches)) { |
| 18 | - $root = realpath($_SERVER['DOCUMENT_ROOT'] . $matches[0]); |
|
| 18 | + $root = realpath($_SERVER['DOCUMENT_ROOT'].$matches[0]); |
|
| 19 | 19 | if ($root !== false) { |
| 20 | - putenv('TYPO3_PATH_ROOT=' . $root); |
|
| 21 | - putenv('TYPO3_PATH_APP=' . $root); |
|
| 20 | + putenv('TYPO3_PATH_ROOT='.$root); |
|
| 21 | + putenv('TYPO3_PATH_APP='.$root); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |