@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | ) { |
| 119 | 119 | // Get current configuration. |
| 120 | 120 | $result = $queryBuilder |
| 121 | - ->select($table . '.is_listed AS is_listed') |
|
| 121 | + ->select($table.'.is_listed AS is_listed') |
|
| 122 | 122 | ->from($table) |
| 123 | 123 | ->where( |
| 124 | - $queryBuilder->expr()->eq($table . '.uid', intval($id)), |
|
| 124 | + $queryBuilder->expr()->eq($table.'.uid', intval($id)), |
|
| 125 | 125 | Helper::whereExpression($table) |
| 126 | 126 | ) |
| 127 | 127 | ->setMaxResults(1) |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | ) { |
| 144 | 144 | // Get current configuration. |
| 145 | 145 | $result = $queryBuilder |
| 146 | - ->select($table . '.index_autocomplete AS index_autocomplete') |
|
| 146 | + ->select($table.'.index_autocomplete AS index_autocomplete') |
|
| 147 | 147 | ->from($table) |
| 148 | 148 | ->where( |
| 149 | - $queryBuilder->expr()->eq($table . '.uid', intval($id)), |
|
| 149 | + $queryBuilder->expr()->eq($table.'.uid', intval($id)), |
|
| 150 | 150 | Helper::whereExpression($table) |
| 151 | 151 | ) |
| 152 | 152 | ->setMaxResults(1) |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | } else { |
| 168 | 168 | // Get current index name. |
| 169 | 169 | $result = $queryBuilder |
| 170 | - ->select($table . '.index_autocomplete AS index_autocomplete') |
|
| 170 | + ->select($table.'.index_autocomplete AS index_autocomplete') |
|
| 171 | 171 | ->from($table) |
| 172 | 172 | ->where( |
| 173 | - $queryBuilder->expr()->eq($table . '.uid', intval($id)), |
|
| 173 | + $queryBuilder->expr()->eq($table.'.uid', intval($id)), |
|
| 174 | 174 | Helper::whereExpression($table) |
| 175 | 175 | ) |
| 176 | 176 | ->setMaxResults(1) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $fieldArray['index_indexed'] = $resArray['index_autocomplete']; |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | - Helper::devLog('Prevented change of index_name for UID ' . $id . ' in table "' . $table . '"', DEVLOG_SEVERITY_NOTICE); |
|
| 184 | + Helper::devLog('Prevented change of index_name for UID '.$id.' in table "'.$table.'"', DEVLOG_SEVERITY_NOTICE); |
|
| 185 | 185 | } |
| 186 | 186 | break; |
| 187 | 187 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | if ($solr->ready) { |
| 251 | 251 | // Delete Solr document. |
| 252 | 252 | $updateQuery = $solr->service->createUpdate(); |
| 253 | - $updateQuery->addDeleteQuery('uid:' . $id); |
|
| 253 | + $updateQuery->addDeleteQuery('uid:'.$id); |
|
| 254 | 254 | $updateQuery->addCommit(); |
| 255 | 255 | $solr->service->update($updateQuery); |
| 256 | 256 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | if ($doc->ready) { |
| 261 | 261 | Indexer::add($doc, $resArray['core']); |
| 262 | 262 | } else { |
| 263 | - Helper::devLog('Failed to re-index document with UID ' . $id, DEVLOG_SEVERITY_ERROR); |
|
| 263 | + Helper::devLog('Failed to re-index document with UID '.$id, DEVLOG_SEVERITY_ERROR); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | if ($solr->ready) { |
| 331 | 331 | // Delete Solr document. |
| 332 | 332 | $updateQuery = $solr->service->createUpdate(); |
| 333 | - $updateQuery->addDeleteQuery('uid:' . $id); |
|
| 333 | + $updateQuery->addDeleteQuery('uid:'.$id); |
|
| 334 | 334 | $updateQuery->addCommit(); |
| 335 | 335 | $solr->service->update($updateQuery); |
| 336 | 336 | if ($command == 'delete') { |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | if ($doc->ready) { |
| 344 | 344 | Indexer::add($doc, $resArray['core']); |
| 345 | 345 | } else { |
| 346 | - Helper::devLog('Failed to re-index document with UID ' . $id, DEVLOG_SEVERITY_ERROR); |
|
| 346 | + Helper::devLog('Failed to re-index document with UID '.$id, DEVLOG_SEVERITY_ERROR); |
|
| 347 | 347 | } |
| 348 | 348 | break; |
| 349 | 349 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | // Nothing to do here. |
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | - Helper::devLog('Core ' . $resArray['core'] . ' could not be deleted from Apache Solr', DEVLOG_SEVERITY_WARNING); |
|
| 400 | + Helper::devLog('Core '.$resArray['core'].' could not be deleted from Apache Solr', DEVLOG_SEVERITY_WARNING); |
|
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | // Get next available core name if none given. |
| 130 | 130 | if (empty($core)) { |
| 131 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
| 131 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
| 132 | 132 | } |
| 133 | 133 | // Get Solr service instance. |
| 134 | 134 | $solr = self::getInstance($core); |
@@ -224,13 +224,13 @@ discard block |
||
| 224 | 224 | ->execute(); |
| 225 | 225 | |
| 226 | 226 | while ($resArray = $result->fetch()) { |
| 227 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
| 227 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | // Check if queried field is valid. |
| 231 | 231 | $splitQuery = explode(':', $query, 2); |
| 232 | 232 | if (in_array($splitQuery[0], $fields)) { |
| 233 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
| 233 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
| 234 | 234 | } else { |
| 235 | 235 | $query = self::escapeQuery($query); |
| 236 | 236 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | { |
| 295 | 295 | $number = max(intval($number), 0); |
| 296 | 296 | // Check if core already exists. |
| 297 | - $solr = self::getInstance('dlfCore' . $number); |
|
| 297 | + $solr = self::getInstance('dlfCore'.$number); |
|
| 298 | 298 | if (!$solr->ready) { |
| 299 | 299 | return $number; |
| 300 | 300 | } else { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $config['path'] .= '/'; |
| 331 | 331 | } |
| 332 | 332 | // Set connection timeout lower than PHP's max_execution_time. |
| 333 | - $max_execution_time = intval(ini_get('max_execution_time')) ?: 30; |
|
| 333 | + $max_execution_time = intval(ini_get('max_execution_time')) ? : 30; |
|
| 334 | 334 | $config['timeout'] = MathUtility::forceIntegerInRange($conf['solrTimeout'], 1, $max_execution_time, 10); |
| 335 | 335 | $this->config = $config; |
| 336 | 336 | } |
@@ -364,13 +364,13 @@ discard block |
||
| 364 | 364 | // Extend filter query to get all documents with the same uids. |
| 365 | 365 | foreach ($params['filterquery'] as $key => $value) { |
| 366 | 366 | if (isset($value['query'])) { |
| 367 | - $params['filterquery'][$key]['query'] = '{!join from=uid to=uid}' . $value['query']; |
|
| 367 | + $params['filterquery'][$key]['query'] = '{!join from=uid to=uid}'.$value['query']; |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | // Set filter query to just get toplevel documents. |
| 371 | 371 | $params['filterquery'][] = ['query' => 'toplevel:true']; |
| 372 | 372 | // Set join query to get all documents with the same uids. |
| 373 | - $params['query'] = '{!join from=uid to=uid}' . $params['query']; |
|
| 373 | + $params['query'] = '{!join from=uid to=uid}'.$params['query']; |
|
| 374 | 374 | // Perform search to determine the total number of toplevel hits and fetch the required rows. |
| 375 | 375 | $selectQuery = $this->service->createSelect($params); |
| 376 | 376 | $results = $this->service->select($selectQuery); |
@@ -560,12 +560,12 @@ discard block |
||
| 560 | 560 | */ |
| 561 | 561 | public function __get($var) |
| 562 | 562 | { |
| 563 | - $method = '_get' . ucfirst($var); |
|
| 563 | + $method = '_get'.ucfirst($var); |
|
| 564 | 564 | if ( |
| 565 | 565 | !property_exists($this, $var) |
| 566 | 566 | || !method_exists($this, $method) |
| 567 | 567 | ) { |
| 568 | - Helper::devLog('There is no getter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
| 568 | + Helper::devLog('There is no getter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
| 569 | 569 | return; |
| 570 | 570 | } else { |
| 571 | 571 | return $this->$method(); |
@@ -598,12 +598,12 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | public function __set($var, $value) |
| 600 | 600 | { |
| 601 | - $method = '_set' . ucfirst($var); |
|
| 601 | + $method = '_set'.ucfirst($var); |
|
| 602 | 602 | if ( |
| 603 | 603 | !property_exists($this, $var) |
| 604 | 604 | || !method_exists($this, $method) |
| 605 | 605 | ) { |
| 606 | - Helper::devLog('There is no setter function for property "' . $var . '"', DEVLOG_SEVERITY_WARNING); |
|
| 606 | + Helper::devLog('There is no setter function for property "'.$var.'"', DEVLOG_SEVERITY_WARNING); |
|
| 607 | 607 | } else { |
| 608 | 608 | $this->$method($value); |
| 609 | 609 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | 'scheme' => $this->config['scheme'], |
| 639 | 639 | 'host' => $this->config['host'], |
| 640 | 640 | 'port' => $this->config['port'], |
| 641 | - 'path' => '/' . $this->config['path'], |
|
| 641 | + 'path' => '/'.$this->config['path'], |
|
| 642 | 642 | 'core' => $core, |
| 643 | 643 | 'username' => $this->config['username'], |
| 644 | 644 | 'password' => $this->config['password'] |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ->delete('tx_dlf_tokens') |
| 88 | 88 | ->where( |
| 89 | 89 | $queryBuilder->expr()->eq('tx_dlf_tokens.ident', $queryBuilder->createNamedParameter('oai')), |
| 90 | - $queryBuilder->expr()->lt('tx_dlf_tokens.tstamp', $queryBuilder->createNamedParameter((int)($GLOBALS['EXEC_TIME'] - $this->conf['expired']))) |
|
| 90 | + $queryBuilder->expr()->lt('tx_dlf_tokens.tstamp', $queryBuilder->createNamedParameter((int) ($GLOBALS['EXEC_TIME'] - $this->conf['expired']))) |
|
| 91 | 91 | ) |
| 92 | 92 | ->execute(); |
| 93 | 93 | |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 158 | 158 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 159 | 159 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 160 | - $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'] . ' ' . $this->formats['oai_dc']['schema']); |
|
| 160 | + $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'].' '.$this->formats['oai_dc']['schema']); |
|
| 161 | 161 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['record_id'], ENT_NOQUOTES, 'UTF-8'))); |
| 162 | 162 | if (!empty($metadata['purl'])) { |
| 163 | 163 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['purl'], ENT_NOQUOTES, 'UTF-8'))); |
| 164 | 164 | } |
| 165 | 165 | if (!empty($metadata['prod_id'])) { |
| 166 | - $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:' . htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 166 | + $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:'.htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 167 | 167 | } |
| 168 | 168 | if (!empty($metadata['urn'])) { |
| 169 | 169 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['urn'], ENT_NOQUOTES, 'UTF-8'))); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | // Add attributes and build XML tree. |
| 262 | 262 | $epicur->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 263 | - $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'] . ' ' . $this->formats['epicur']['schema']); |
|
| 263 | + $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'].' '.$this->formats['epicur']['schema']); |
|
| 264 | 264 | // Do we update an URN or register a new one? |
| 265 | 265 | if ($metadata['tstamp'] == $metadata['crdate']) { |
| 266 | 266 | $update->setAttribute('type', 'urn_new'); |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | // Import node into \DOMDocument. |
| 308 | 308 | $mets = $this->oai->importNode($root->item(0), true); |
| 309 | 309 | } else { |
| 310 | - Helper::devLog('No METS part found in document with location "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR); |
|
| 310 | + Helper::devLog('No METS part found in document with location "'.$metadata['location'].'"', DEVLOG_SEVERITY_ERROR); |
|
| 311 | 311 | } |
| 312 | 312 | } else { |
| 313 | - Helper::devLog('Could not load XML file from "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR); |
|
| 313 | + Helper::devLog('Could not load XML file from "'.$metadata['location'].'"', DEVLOG_SEVERITY_ERROR); |
|
| 314 | 314 | } |
| 315 | 315 | if ($mets === null) { |
| 316 | 316 | $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!'), ENT_NOQUOTES, 'UTF-8')); |
@@ -346,15 +346,15 @@ discard block |
||
| 346 | 346 | if (strpos($this->conf['stylesheet'], 'EXT:') === 0) { |
| 347 | 347 | [$extKey, $filePath] = explode('/', substr($this->conf['stylesheet'], 4), 2); |
| 348 | 348 | if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) { |
| 349 | - $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey)) . $filePath; |
|
| 349 | + $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey)).$filePath; |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->conf['stylesheet']); |
| 353 | 353 | } else { |
| 354 | 354 | // Use default stylesheet if no custom stylesheet is given. |
| 355 | - $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 355 | + $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 356 | 356 | } |
| 357 | - $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8') . '"')); |
|
| 357 | + $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"')); |
|
| 358 | 358 | // Create root element. |
| 359 | 359 | $root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH'); |
| 360 | 360 | $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -405,10 +405,10 @@ discard block |
||
| 405 | 405 | // Send headers. |
| 406 | 406 | header('HTTP/1.1 200 OK'); |
| 407 | 407 | header('Cache-Control: no-cache'); |
| 408 | - header('Content-Length: ' . strlen($content)); |
|
| 408 | + header('Content-Length: '.strlen($content)); |
|
| 409 | 409 | header('Content-Type: text/xml; charset=utf-8'); |
| 410 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 411 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 410 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 411 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 412 | 412 | echo $content; |
| 413 | 413 | exit; |
| 414 | 414 | } |
@@ -469,16 +469,16 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_dlf_documents'); |
| 471 | 471 | |
| 472 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 473 | - 'FROM `tx_dlf_documents` ' . |
|
| 474 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 475 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 476 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 477 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 478 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 479 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 480 | - $where . |
|
| 481 | - 'AND ' . Helper::whereExpression('tx_dlf_collections'); |
|
| 472 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 473 | + 'FROM `tx_dlf_documents` '. |
|
| 474 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 475 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 476 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 477 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 478 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 479 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 480 | + $where. |
|
| 481 | + 'AND '.Helper::whereExpression('tx_dlf_collections'); |
|
| 482 | 482 | |
| 483 | 483 | $values = [ |
| 484 | 484 | $this->piVars['identifier'], |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $timestamp = $resArray['tstamp']; |
| 606 | 606 | $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp); |
| 607 | 607 | } else { |
| 608 | - Helper::devLog('No records found with PID ' . $this->conf['pages'], DEVLOG_SEVERITY_NOTICE); |
|
| 608 | + Helper::devLog('No records found with PID '.$this->conf['pages'], DEVLOG_SEVERITY_NOTICE); |
|
| 609 | 609 | } |
| 610 | 610 | $linkConf = [ |
| 611 | 611 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | } |
| 867 | 867 | $resArray = $allResults[0]; |
| 868 | 868 | if ($resArray['index_query'] != "") { |
| 869 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
| 869 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
| 870 | 870 | } else { |
| 871 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
| 871 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
| 872 | 872 | } |
| 873 | 873 | } else { |
| 874 | 874 | // If no set is specified we have to query for all collections |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | } |
| 877 | 877 | // Check for required fields. |
| 878 | 878 | foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) { |
| 879 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
| 879 | + $solr_query .= ' NOT '.$required.':""'; |
|
| 880 | 880 | } |
| 881 | 881 | // toplevel="true" is always required |
| 882 | 882 | $solr_query .= ' AND toplevel:true'; |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | || is_array($date_array = strptime($this->piVars['from'], '%Y-%m-%d')) |
| 890 | 890 | ) { |
| 891 | 891 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 892 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
|
| 892 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
| 893 | 893 | } else { |
| 894 | 894 | throw new \Exception('badArgument'); |
| 895 | 895 | } |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | || is_array($date_array = strptime($this->piVars['until'], '%Y-%m-%d')) |
| 904 | 904 | ) { |
| 905 | 905 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 906 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
| 906 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
| 907 | 907 | if ($from != "*" && $from > $until) { |
| 908 | 908 | throw new \Exception('badArgument'); |
| 909 | 909 | } |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | throw new \Exception('badArgument'); |
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
| 923 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
| 924 | 924 | $documentSet = []; |
| 925 | 925 | $solr = Solr::getInstance($this->conf['solrcore']); |
| 926 | 926 | if (!$solr->ready) { |
@@ -957,22 +957,22 @@ discard block |
||
| 957 | 957 | */ |
| 958 | 958 | protected function generateOutputForDocumentList(DocumentList $documentListSet) |
| 959 | 959 | { |
| 960 | - $documentsToProcess = $documentListSet->removeRange(0, (int)$this->conf['limit']); |
|
| 960 | + $documentsToProcess = $documentListSet->removeRange(0, (int) $this->conf['limit']); |
|
| 961 | 961 | $verb = $this->piVars['verb']; |
| 962 | 962 | |
| 963 | 963 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 964 | 964 | ->getConnectionForTable('tx_dlf_documents'); |
| 965 | 965 | |
| 966 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 967 | - 'FROM `tx_dlf_documents` ' . |
|
| 968 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 969 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 970 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 971 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 972 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 973 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 974 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 975 | - 'GROUP BY `tx_dlf_documents`.`uid` ' . |
|
| 966 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 967 | + 'FROM `tx_dlf_documents` '. |
|
| 968 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 969 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 970 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 971 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 972 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 973 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 974 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 975 | + 'GROUP BY `tx_dlf_documents`.`uid` '. |
|
| 976 | 976 | 'LIMIT ?'; |
| 977 | 977 | |
| 978 | 978 | $values = [ |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | if ($solr->ready) { |
| 56 | 56 | $query = $solr->service->createSelect(); |
| 57 | 57 | $query->setFields(['id', 'uid', 'page']); |
| 58 | - $query->setQuery('fulltext:(' . Solr::escapeQuery((string) $parameters['q']) . ') AND uid:' . intval($parameters['uid'])); |
|
| 58 | + $query->setQuery('fulltext:('.Solr::escapeQuery((string) $parameters['q']).') AND uid:'.intval($parameters['uid'])); |
|
| 59 | 59 | $query->setStart($count)->setRows(20); |
| 60 | 60 | $hl = $query->getHighlighting(); |
| 61 | 61 | $hl->setFields(['fulltext']); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | foreach ($rows as $row) { |
| 118 | 118 | if ($row['format'] === 0 && $row['xpath']) { |
| 119 | - $uids[] = (int)$row['uid']; |
|
| 119 | + $uids[] = (int) $row['uid']; |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | return $uids; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $result = $queryBuilder |
| 225 | 225 | ->select('COLUMN_NAME') |
| 226 | 226 | ->from('INFORMATION_SCHEMA.COLUMNS') |
| 227 | - ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="' . $database . '" AND COLUMN_NAME="document_format"') |
|
| 227 | + ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="'.$database.'" AND COLUMN_NAME="document_format"') |
|
| 228 | 228 | ->execute(); |
| 229 | 229 | while ($resArray = $result->fetch()) { |
| 230 | 230 | if ($resArray['COLUMN_NAME'] === 'document_format') { |