@@ -120,7 +120,7 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | private function getQuery($fields, $parameters) |
| 122 | 122 | { |
| 123 | - return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
|
| 123 | + return $fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$fields['uid'].':'.$this->getUid($parameters['uid']); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -28,16 +28,14 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchInDocument |
|
| 32 | -{ |
|
| 31 | +class SearchInDocument { |
|
| 33 | 32 | /** |
| 34 | 33 | * The main method of the eID script |
| 35 | 34 | * |
| 36 | 35 | * @param ServerRequestInterface $request |
| 37 | 36 | * @return ResponseInterface JSON response of search suggestions |
| 38 | 37 | */ |
| 39 | - public function main(ServerRequestInterface $request) |
|
| 40 | - { |
|
| 38 | + public function main(ServerRequestInterface $request) { |
|
| 41 | 39 | $output = [ |
| 42 | 40 | 'documents' => [], |
| 43 | 41 | 'numFound' => 0 |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | * |
| 119 | 117 | * @return string SOLR query |
| 120 | 118 | */ |
| 121 | - private function getQuery($fields, $parameters) |
|
| 122 | - { |
|
| 119 | + private function getQuery($fields, $parameters) { |
|
| 123 | 120 | return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
| 124 | 121 | } |
| 125 | 122 | |
@@ -133,8 +130,7 @@ discard block |
||
| 133 | 130 | * |
| 134 | 131 | * @return int|string uid of the document |
| 135 | 132 | */ |
| 136 | - private function getUid($uid) |
|
| 137 | - { |
|
| 133 | + private function getUid($uid) { |
|
| 138 | 134 | return is_numeric($uid) ? intval($uid) : $uid; |
| 139 | 135 | } |
| 140 | 136 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | ]; |
| 45 | 45 | // Get input parameters and decrypt core name. |
| 46 | 46 | $parameters = $request->getParsedBody(); |
| 47 | - if ($parameters === null) { |
|
| 47 | + if ($parameters === NULL) { |
|
| 48 | 48 | throw new \InvalidArgumentException('No parameters passed!', 1632322297); |
| 49 | 49 | } |
| 50 | 50 | $encrypted = (string) $parameters['encrypted']; |
@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | * @subpackage dlf |
| 35 | 35 | * @access public |
| 36 | 36 | */ |
| 37 | -class PageViewProxy |
|
| 38 | -{ |
|
| 37 | +class PageViewProxy { |
|
| 39 | 38 | /** |
| 40 | 39 | * @var RequestFactory |
| 41 | 40 | */ |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | */ |
| 47 | 46 | protected $extConf; |
| 48 | 47 | |
| 49 | - public function __construct() |
|
| 50 | - { |
|
| 48 | + public function __construct() { |
|
| 51 | 49 | $this->requestFactory = GeneralUtility::makeInstance(RequestFactory::class); |
| 52 | 50 | $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf'); |
| 53 | 51 | } |
@@ -173,8 +171,7 @@ discard block |
||
| 173 | 171 | * @param ServerRequestInterface $request |
| 174 | 172 | * @return ResponseInterface |
| 175 | 173 | */ |
| 176 | - public function main(ServerRequestInterface $request) |
|
| 177 | - { |
|
| 174 | + public function main(ServerRequestInterface $request) { |
|
| 178 | 175 | switch ($request->getMethod()) { |
| 179 | 176 | case 'OPTIONS': |
| 180 | 177 | return $this->handleOptions($request); |
@@ -140,11 +140,11 @@ |
||
| 140 | 140 | // For performance, don't download content up-front. Rather, we'll |
| 141 | 141 | // download and upload simultaneously. |
| 142 | 142 | // https://docs.guzzlephp.org/en/6.5/request-options.html#stream |
| 143 | - 'stream' => true, |
|
| 143 | + 'stream' => TRUE, |
|
| 144 | 144 | |
| 145 | 145 | // Don't throw exceptions when a non-success status code is |
| 146 | 146 | // received. We handle these manually. |
| 147 | - 'http_errors' => false, |
|
| 147 | + 'http_errors' => FALSE, |
|
| 148 | 148 | ]); |
| 149 | 149 | } catch (\Exception $e) { |
| 150 | 150 | return new JsonResponse(['message' => 'Could not fetch resource of given URL.'], 500); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $parameters = $request->getParsedBody(); |
| 46 | 46 | $solrCore = (string) $parameters['solrcore']; |
| 47 | 47 | $uHash = (string) $parameters['uHash']; |
| 48 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 48 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 49 | 49 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
| 50 | 50 | } |
| 51 | 51 | // Perform Solr query. |
@@ -30,16 +30,14 @@ |
||
| 30 | 30 | * @subpackage dlf |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class SearchSuggest |
|
| 34 | -{ |
|
| 33 | +class SearchSuggest { |
|
| 35 | 34 | /** |
| 36 | 35 | * The main method of the eID script |
| 37 | 36 | * |
| 38 | 37 | * @param ServerRequestInterface $request |
| 39 | 38 | * @return ResponseInterface XML response of search suggestions |
| 40 | 39 | */ |
| 41 | - public function main(ServerRequestInterface $request) |
|
| 42 | - { |
|
| 40 | + public function main(ServerRequestInterface $request) { |
|
| 43 | 41 | $output = []; |
| 44 | 42 | // Get input parameters and decrypt core name. |
| 45 | 43 | $parameters = $request->getParsedBody(); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $parameters = $request->getParsedBody(); |
| 46 | 46 | $solrCore = (string) $parameters['solrcore']; |
| 47 | 47 | $uHash = (string) $parameters['uHash']; |
| 48 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
| 48 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === FALSE) { |
|
| 49 | 49 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
| 50 | 50 | } |
| 51 | 51 | // Perform Solr query. |
@@ -65,22 +65,22 @@ |
||
| 65 | 65 | $_EXTKEY = 'dlf'; |
| 66 | 66 | // Register tools for toolbox plugin. |
| 67 | 67 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
| 68 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 68 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool'; |
|
| 69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool'; |
|
| 70 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltextdownloadtool'; |
|
| 71 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool'; |
|
| 72 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool'; |
|
| 73 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool'; |
|
| 74 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool'; |
|
| 75 | 75 | // Register hooks. |
| 76 | 76 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 77 | 77 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
| 78 | 78 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class; |
| 79 | 79 | // Register AJAX eID handlers. |
| 80 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class . '::main'; |
|
| 81 | -$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class . '::main'; |
|
| 80 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class.'::main'; |
|
| 81 | +$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class.'::main'; |
|
| 82 | 82 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) { |
| 83 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
|
| 83 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class.'::main'; |
|
| 84 | 84 | } |
| 85 | 85 | // Use Caching Framework for Solr queries |
| 86 | 86 | if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) { |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | // Register AJAX eID handlers. |
| 80 | 80 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class . '::main'; |
| 81 | 81 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class . '::main'; |
| 82 | -if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) { |
|
| 82 | +if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? FALSE) { |
|
| 83 | 83 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
| 84 | 84 | } |
| 85 | 85 | // Use Caching Framework for Solr queries |
@@ -33,13 +33,13 @@ |
||
| 33 | 33 | $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings); |
| 34 | 34 | |
| 35 | 35 | // Set replacements. |
| 36 | - $args['###TITLES###'] = $foundNumbers['titles'] . ' ' . htmlspecialchars( |
|
| 36 | + $args['###TITLES###'] = $foundNumbers['titles'].' '.htmlspecialchars( |
|
| 37 | 37 | LocalizationUtility::translate( |
| 38 | 38 | ($foundNumbers['titles'] > 1 ? 'titles' : 'title'), 'dlf' |
| 39 | 39 | ) |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - $args['###VOLUMES###'] = $foundNumbers['volumes'] . ' ' . htmlspecialchars( |
|
| 42 | + $args['###VOLUMES###'] = $foundNumbers['volumes'].' '.htmlspecialchars( |
|
| 43 | 43 | LocalizationUtility::translate( |
| 44 | 44 | ($foundNumbers['volumes'] > 1 ? 'volumes' : 'volume'), 'dlf' |
| 45 | 45 | ) |
@@ -21,15 +21,13 @@ |
||
| 21 | 21 | * @subpackage dlf |
| 22 | 22 | * @access public |
| 23 | 23 | */ |
| 24 | -class StatisticsController extends AbstractController |
|
| 25 | -{ |
|
| 24 | +class StatisticsController extends AbstractController { |
|
| 26 | 25 | /** |
| 27 | 26 | * The main method of the plugin |
| 28 | 27 | * |
| 29 | 28 | * @return void |
| 30 | 29 | */ |
| 31 | - public function mainAction() |
|
| 32 | - { |
|
| 30 | + public function mainAction() { |
|
| 33 | 31 | $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings); |
| 34 | 32 | |
| 35 | 33 | // Set replacements. |
@@ -210,7 +210,6 @@ |
||
| 210 | 210 | * Volumes are documents that are both |
| 211 | 211 | * a) "leaf" elements i.e. partof != 0 |
| 212 | 212 | * b) "root" elements that are not referenced by other documents ("root" elements that have no descendants) |
| 213 | - |
|
| 214 | 213 | * @param array $settings |
| 215 | 214 | * |
| 216 | 215 | * @return array |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $excludeOtherWhere = ''; |
| 358 | 358 | if ($settings['excludeOther']) { |
| 359 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']); |
|
| 359 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']); |
|
| 360 | 360 | } |
| 361 | 361 | // Check if there are any metadata to suggest. |
| 362 | 362 | $result = $queryBuilder |
@@ -408,12 +408,12 @@ discard block |
||
| 408 | 408 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 409 | 409 | ->getConnectionForTable('tx_dlf_documents'); |
| 410 | 410 | |
| 411 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 412 | - 'FROM `tx_dlf_documents` ' . |
|
| 413 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 414 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 415 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 416 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 411 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 412 | + 'FROM `tx_dlf_documents` '. |
|
| 413 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 414 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 415 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 416 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 417 | 417 | $where; |
| 418 | 418 | |
| 419 | 419 | $values = [ |
@@ -443,13 +443,13 @@ discard block |
||
| 443 | 443 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 444 | 444 | ->getConnectionForTable('tx_dlf_documents'); |
| 445 | 445 | |
| 446 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 447 | - 'FROM `tx_dlf_documents` ' . |
|
| 448 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 449 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 450 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 451 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 452 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 446 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 447 | + 'FROM `tx_dlf_documents` '. |
|
| 448 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 449 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 450 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 451 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 452 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 453 | 453 | 'GROUP BY `tx_dlf_documents`.`uid` '; |
| 454 | 454 | |
| 455 | 455 | $values = [ |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return \Kitodo\Dlf\Domain\Model\Document|null |
| 50 | 50 | */ |
| 51 | - public function findOneByParameters($parameters) |
|
| 52 | - { |
|
| 51 | + public function findOneByParameters($parameters) { |
|
| 53 | 52 | $doc = null; |
| 54 | 53 | $document = null; |
| 55 | 54 | |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * |
| 94 | 93 | * @return \Kitodo\Dlf\Domain\Model\Document|null |
| 95 | 94 | */ |
| 96 | - public function findOldestDocument() |
|
| 97 | - { |
|
| 95 | + public function findOldestDocument() { |
|
| 98 | 96 | $query = $this->createQuery(); |
| 99 | 97 | |
| 100 | 98 | $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]); |
@@ -108,8 +106,7 @@ discard block |
||
| 108 | 106 | * @param \Kitodo\Dlf\Domain\Model\Structure $structure |
| 109 | 107 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
| 110 | 108 | */ |
| 111 | - public function getChildrenOfYearAnchor($partOf, $structure) |
|
| 112 | - { |
|
| 109 | + public function getChildrenOfYearAnchor($partOf, $structure) { |
|
| 113 | 110 | $query = $this->createQuery(); |
| 114 | 111 | |
| 115 | 112 | $query->matching($query->equals('structure', $structure)); |
@@ -130,8 +127,7 @@ discard block |
||
| 130 | 127 | * |
| 131 | 128 | * @return \Kitodo\Dlf\Domain\Model\Document|null |
| 132 | 129 | */ |
| 133 | - public function findOneByIdAndSettings($uid, $settings = []) |
|
| 134 | - { |
|
| 130 | + public function findOneByIdAndSettings($uid, $settings = []) { |
|
| 135 | 131 | $settings = ['documentSets' => $uid]; |
| 136 | 132 | |
| 137 | 133 | return $this->findDocumentsBySettings($settings)->getFirst(); |
@@ -144,8 +140,7 @@ discard block |
||
| 144 | 140 | * |
| 145 | 141 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
| 146 | 142 | */ |
| 147 | - public function findDocumentsBySettings($settings = []) |
|
| 148 | - { |
|
| 143 | + public function findDocumentsBySettings($settings = []) { |
|
| 149 | 144 | $query = $this->createQuery(); |
| 150 | 145 | |
| 151 | 146 | $constraints = []; |
@@ -175,8 +170,7 @@ discard block |
||
| 175 | 170 | * |
| 176 | 171 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
| 177 | 172 | */ |
| 178 | - public function findAllByCollectionsLimited($collections, $limit = 50) |
|
| 179 | - { |
|
| 173 | + public function findAllByCollectionsLimited($collections, $limit = 50) { |
|
| 180 | 174 | $query = $this->createQuery(); |
| 181 | 175 | |
| 182 | 176 | // order by start_date -> start_time... |
@@ -213,8 +207,7 @@ discard block |
||
| 213 | 207 | * |
| 214 | 208 | * @return array |
| 215 | 209 | */ |
| 216 | - public function getStatisticsForSelectedCollection($settings) |
|
| 217 | - { |
|
| 210 | + public function getStatisticsForSelectedCollection($settings) { |
|
| 218 | 211 | if ($settings['collections']) { |
| 219 | 212 | // Include only selected collections. |
| 220 | 213 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -348,8 +341,7 @@ discard block |
||
| 348 | 341 | * |
| 349 | 342 | * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
| 350 | 343 | */ |
| 351 | - public function getTableOfContentsFromDb($uid, $pid, $settings) |
|
| 352 | - { |
|
| 344 | + public function getTableOfContentsFromDb($uid, $pid, $settings) { |
|
| 353 | 345 | // Build table of contents from database. |
| 354 | 346 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 355 | 347 | ->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -397,8 +389,7 @@ discard block |
||
| 397 | 389 | * |
| 398 | 390 | * @return array The found document object |
| 399 | 391 | */ |
| 400 | - public function getOaiRecord($settings, $parameters) |
|
| 401 | - { |
|
| 392 | + public function getOaiRecord($settings, $parameters) { |
|
| 402 | 393 | $where = ''; |
| 403 | 394 | |
| 404 | 395 | if (!$settings['show_userdefined']) { |
@@ -438,8 +429,7 @@ discard block |
||
| 438 | 429 | * |
| 439 | 430 | * @return array The found document objects |
| 440 | 431 | */ |
| 441 | - public function getOaiDocumentList($settings, $documentsToProcess) |
|
| 442 | - { |
|
| 432 | + public function getOaiDocumentList($settings, $documentsToProcess) { |
|
| 443 | 433 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 444 | 434 | ->getConnectionForTable('tx_dlf_documents'); |
| 445 | 435 | |
@@ -474,8 +464,7 @@ discard block |
||
| 474 | 464 | * |
| 475 | 465 | * @return array |
| 476 | 466 | */ |
| 477 | - public function findAllByUids($uids, $checkPartof = false) |
|
| 478 | - { |
|
| 467 | + public function findAllByUids($uids, $checkPartof = false) { |
|
| 479 | 468 | // get all documents from db we are talking about |
| 480 | 469 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
| 481 | 470 | $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -524,8 +513,7 @@ discard block |
||
| 524 | 513 | * |
| 525 | 514 | * @return array |
| 526 | 515 | */ |
| 527 | - public function findChildrenOfEach(array $uids) |
|
| 528 | - { |
|
| 516 | + public function findChildrenOfEach(array $uids) { |
|
| 529 | 517 | $allDocuments = $this->findAllByUids($uids, true); |
| 530 | 518 | |
| 531 | 519 | $result = []; |
@@ -546,8 +534,7 @@ discard block |
||
| 546 | 534 | * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata |
| 547 | 535 | * @return array |
| 548 | 536 | */ |
| 549 | - public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null) |
|
| 550 | - { |
|
| 537 | + public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null) { |
|
| 551 | 538 | // set settings global inside this repository |
| 552 | 539 | // (may be necessary when SolrSearch calls back) |
| 553 | 540 | $this->settings = $settings; |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function findOneByParameters($parameters) |
| 52 | 52 | { |
| 53 | - $doc = null; |
|
| 54 | - $document = null; |
|
| 53 | + $doc = NULL; |
|
| 54 | + $document = NULL; |
|
| 55 | 55 | |
| 56 | 56 | if (isset($parameters['id']) && MathUtility::canBeInterpretedAsInteger($parameters['id'])) { |
| 57 | 57 | |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | } else if (isset($parameters['location']) && GeneralUtility::isValidUrl($parameters['location'])) { |
| 65 | 65 | |
| 66 | - $doc = Doc::getInstance($parameters['location'], [], true); |
|
| 66 | + $doc = Doc::getInstance($parameters['location'], [], TRUE); |
|
| 67 | 67 | |
| 68 | 68 | if ($doc->recordId) { |
| 69 | 69 | $document = $this->findOneByRecordId($doc->recordId); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if ($document === null) { |
|
| 72 | + if ($document === NULL) { |
|
| 73 | 73 | // create new (dummy) Document object |
| 74 | 74 | $document = GeneralUtility::makeInstance(Document::class); |
| 75 | 75 | $document->setLocation($parameters['location']); |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if ($document !== null && $doc === null) { |
|
| 81 | - $doc = Doc::getInstance($document->getLocation(), [], true); |
|
| 80 | + if ($document !== NULL && $doc === NULL) { |
|
| 81 | + $doc = Doc::getInstance($document->getLocation(), [], TRUE); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if ($doc !== null) { |
|
| 84 | + if ($doc !== NULL) { |
|
| 85 | 85 | $document->setDoc($doc); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (isset($settings['excludeOther']) && (int) $settings['excludeOther'] === 0) { |
| 158 | - $query->getQuerySettings()->setRespectStoragePage(false); |
|
| 158 | + $query->getQuerySettings()->setRespectStoragePage(FALSE); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if (count($constraints)) { |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | * |
| 475 | 475 | * @return array |
| 476 | 476 | */ |
| 477 | - public function findAllByUids($uids, $checkPartof = false) |
|
| 477 | + public function findAllByUids($uids, $checkPartof = FALSE) |
|
| 478 | 478 | { |
| 479 | 479 | // get all documents from db we are talking about |
| 480 | 480 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | public function findChildrenOfEach(array $uids) |
| 528 | 528 | { |
| 529 | - $allDocuments = $this->findAllByUids($uids, true); |
|
| 529 | + $allDocuments = $this->findAllByUids($uids, TRUE); |
|
| 530 | 530 | |
| 531 | 531 | $result = []; |
| 532 | 532 | foreach ($allDocuments as $doc) { |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata |
| 547 | 547 | * @return array |
| 548 | 548 | */ |
| 549 | - public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null) |
|
| 549 | + public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = NULL) |
|
| 550 | 550 | { |
| 551 | 551 | // set settings global inside this repository |
| 552 | 552 | // (may be necessary when SolrSearch calls back) |
@@ -15,12 +15,10 @@ discard block |
||
| 15 | 15 | use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; |
| 16 | 16 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; |
| 17 | 17 | |
| 18 | -class StdWrapViewHelper extends AbstractViewHelper |
|
| 19 | -{ |
|
| 18 | +class StdWrapViewHelper extends AbstractViewHelper { |
|
| 20 | 19 | protected $escapeOutput = false; |
| 21 | 20 | |
| 22 | - public function initializeArguments() |
|
| 23 | - { |
|
| 21 | + public function initializeArguments() { |
|
| 24 | 22 | parent::initializeArguments(); |
| 25 | 23 | $this->registerArgument('wrap', 'string', 'The wrap information', true); |
| 26 | 24 | $this->registerArgument('data', 'array', 'Data for the content object', false); |
@@ -31,8 +29,7 @@ discard block |
||
| 31 | 29 | * |
| 32 | 30 | * @return string |
| 33 | 31 | */ |
| 34 | - public function render() |
|
| 35 | - { |
|
| 32 | + public function render() { |
|
| 36 | 33 | $wrap = $this->arguments['wrap']; |
| 37 | 34 | $data = $this->arguments['data'] ?? []; |
| 38 | 35 | |
@@ -17,13 +17,13 @@ |
||
| 17 | 17 | |
| 18 | 18 | class StdWrapViewHelper extends AbstractViewHelper |
| 19 | 19 | { |
| 20 | - protected $escapeOutput = false; |
|
| 20 | + protected $escapeOutput = FALSE; |
|
| 21 | 21 | |
| 22 | 22 | public function initializeArguments() |
| 23 | 23 | { |
| 24 | 24 | parent::initializeArguments(); |
| 25 | - $this->registerArgument('wrap', 'string', 'The wrap information', true); |
|
| 26 | - $this->registerArgument('data', 'array', 'Data for the content object', false); |
|
| 25 | + $this->registerArgument('wrap', 'string', 'The wrap information', TRUE); |
|
| 26 | + $this->registerArgument('data', 'array', 'Data for the content object', FALSE); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
| 72 | 72 | |
| 73 | 73 | if ($this->disableJsonWrappedResponse) { |
| 74 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
| 74 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
| 75 | 75 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 85 | 85 | |
| 86 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
| 86 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
| 87 | 87 | $this->httpClient = new HttpClient([ |
| 88 | 88 | 'base_uri' => $this->baseUrl, |
| 89 | 89 | 'http_errors' => false, |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | protected function addSiteConfig($identifier, $baseUrl) |
| 129 | 129 | { |
| 130 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
| 130 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
| 131 | 131 | $siteConfig['base'] = $baseUrl; |
| 132 | 132 | $siteConfig['languages'][0]['base'] = $baseUrl; |
| 133 | 133 | |
| 134 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
| 134 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
| 135 | 135 | @mkdir($siteConfigPath, 0775, true); |
| 136 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
| 136 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | protected function initializeRepository(string $className, int $storagePid) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 153 | 153 | |
| 154 | 154 | $updateQuery = $solr->service->createUpdate(); |
| 155 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
| 155 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
| 156 | 156 | $document = $updateQuery->createDocument(); |
| 157 | 157 | foreach ($jsonDoc as $key => $value) { |
| 158 | 158 | $document->setField($key, $value); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @var bool |
| 51 | 51 | */ |
| 52 | - protected $disableJsonWrappedResponse = false; |
|
| 52 | + protected $disableJsonWrappedResponse = FALSE; |
|
| 53 | 53 | |
| 54 | 54 | /** @var ObjectManager */ |
| 55 | 55 | protected $objectManager; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
| 87 | 87 | $this->httpClient = new HttpClient([ |
| 88 | 88 | 'base_uri' => $this->baseUrl, |
| 89 | - 'http_errors' => false, |
|
| 89 | + 'http_errors' => FALSE, |
|
| 90 | 90 | ]); |
| 91 | 91 | |
| 92 | 92 | $this->addSiteConfig('dlf-testing', $this->baseUrl); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $siteConfig['languages'][0]['base'] = $baseUrl; |
| 133 | 133 | |
| 134 | 134 | $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
| 135 | - @mkdir($siteConfigPath, 0775, true); |
|
| 135 | + @mkdir($siteConfigPath, 0775, TRUE); |
|
| 136 | 136 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | protected function importSolrDocuments(Solr $solr, string $path) |
| 151 | 151 | { |
| 152 | - $jsonDocuments = json_decode(file_get_contents($path), true); |
|
| 152 | + $jsonDocuments = json_decode(file_get_contents($path), TRUE); |
|
| 153 | 153 | |
| 154 | 154 | $updateQuery = $solr->service->createUpdate(); |
| 155 | 155 | $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected $httpClient; |
| 69 | 69 | |
| 70 | - public function __construct() |
|
| 71 | - { |
|
| 70 | + public function __construct() { |
|
| 72 | 71 | parent::__construct(); |
| 73 | 72 | |
| 74 | 73 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
@@ -95,8 +94,7 @@ discard block |
||
| 95 | 94 | $this->addSiteConfig('dlf-testing', $this->baseUrl); |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | - protected function getDlfConfiguration() |
|
| 99 | - { |
|
| 97 | + protected function getDlfConfiguration() { |
|
| 100 | 98 | return [ |
| 101 | 99 | 'fileGrpImages' => 'DEFAULT,MAX', |
| 102 | 100 | 'fileGrpThumbs' => 'THUMBS', |
@@ -134,8 +132,7 @@ discard block |
||
| 134 | 132 | ]; |
| 135 | 133 | } |
| 136 | 134 | |
| 137 | - protected function addSiteConfig($identifier, $baseUrl) |
|
| 138 | - { |
|
| 135 | + protected function addSiteConfig($identifier, $baseUrl) { |
|
| 139 | 136 | $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
| 140 | 137 | $siteConfig['base'] = $baseUrl; |
| 141 | 138 | $siteConfig['languages'][0]['base'] = $baseUrl; |
@@ -145,8 +142,7 @@ discard block |
||
| 145 | 142 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
| 146 | 143 | } |
| 147 | 144 | |
| 148 | - protected function initializeRepository(string $className, int $storagePid) |
|
| 149 | - { |
|
| 145 | + protected function initializeRepository(string $className, int $storagePid) { |
|
| 150 | 146 | $repository = $this->objectManager->get($className); |
| 151 | 147 | |
| 152 | 148 | $querySettings = $this->objectManager->get(Typo3QuerySettings::class); |
@@ -156,8 +152,7 @@ discard block |
||
| 156 | 152 | return $repository; |
| 157 | 153 | } |
| 158 | 154 | |
| 159 | - protected function importSolrDocuments(Solr $solr, string $path) |
|
| 160 | - { |
|
| 155 | + protected function importSolrDocuments(Solr $solr, string $path) { |
|
| 161 | 156 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 162 | 157 | |
| 163 | 158 | $updateQuery = $solr->service->createUpdate(); |
@@ -176,8 +171,7 @@ discard block |
||
| 176 | 171 | $solr->service->update($updateQuery); |
| 177 | 172 | } |
| 178 | 173 | |
| 179 | - protected function initLanguageService(string $locale) |
|
| 180 | - { |
|
| 174 | + protected function initLanguageService(string $locale) { |
|
| 181 | 175 | if (class_exists(\TYPO3\CMS\Core\Localization\LanguageServiceFactory::class)) { |
| 182 | 176 | $GLOBALS['LANG'] = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageServiceFactory::class)->create($locale); |
| 183 | 177 | } else { |
@@ -193,8 +187,7 @@ discard block |
||
| 193 | 187 | /** |
| 194 | 188 | * Assert that $sub is recursively contained within $super. |
| 195 | 189 | */ |
| 196 | - protected function assertArrayMatches(array $sub, array $super, string $message = '') |
|
| 197 | - { |
|
| 190 | + protected function assertArrayMatches(array $sub, array $super, string $message = '') { |
|
| 198 | 191 | $this->assertEquals($sub, ArrayUtility::intersectRecursive($super, $sub), $message); |
| 199 | 192 | } |
| 200 | 193 | } |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | parent::setUp(); |
| 39 | 39 | |
| 40 | - $this->oaiUrl = $this->baseUrl . '/index.php?id=' . $this->oaiPage; |
|
| 41 | - $this->oaiUrlNoStoragePid = $this->baseUrl . '/index.php?id=' . $this->oaiPageNoStoragePid; |
|
| 40 | + $this->oaiUrl = $this->baseUrl.'/index.php?id='.$this->oaiPage; |
|
| 41 | + $this->oaiUrlNoStoragePid = $this->baseUrl.'/index.php?id='.$this->oaiPageNoStoragePid; |
|
| 42 | 42 | |
| 43 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml'); |
|
| 45 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml'); |
|
| 46 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml'); |
|
| 47 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 43 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml'); |
|
| 45 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml'); |
|
| 46 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml'); |
|
| 47 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 49 | 49 | |
| 50 | 50 | $this->persistenceManager = $this->objectManager->get(PersistenceManager::class); |
| 51 | 51 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $coreName = Solr::createCore(); |
| 63 | 63 | $solr = Solr::getInstance($coreName); |
| 64 | 64 | |
| 65 | - $this->importSolrDocuments($solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
| 65 | + $this->importSolrDocuments($solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $oaiCoreModel = $this->solrCoreRepository->findByUid(11001); |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | use SimpleXMLElement; |
| 13 | 13 | use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; |
| 14 | 14 | |
| 15 | -class OaiPmhTest extends FunctionalTestCase |
|
| 16 | -{ |
|
| 15 | +class OaiPmhTest extends FunctionalTestCase { |
|
| 17 | 16 | protected $disableJsonWrappedResponse = true; |
| 18 | 17 | |
| 19 | 18 | protected $coreExtensionsToLoad = [ |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | $this->setUpOaiSolr(); |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | - protected function setUpOaiSolr() |
|
| 57 | - { |
|
| 55 | + protected function setUpOaiSolr() { |
|
| 58 | 56 | // Setup Solr only once for all tests in this suite |
| 59 | 57 | static $solr = null; |
| 60 | 58 | |
@@ -74,8 +72,7 @@ discard block |
||
| 74 | 72 | /** |
| 75 | 73 | * @test |
| 76 | 74 | */ |
| 77 | - public function correctlyRespondsOnBadVerb() |
|
| 78 | - { |
|
| 75 | + public function correctlyRespondsOnBadVerb() { |
|
| 79 | 76 | $client = new HttpClient(); |
| 80 | 77 | $response = $client->get($this->baseUrl, [ |
| 81 | 78 | 'query' => [ |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | /** |
| 101 | 98 | * @test |
| 102 | 99 | */ |
| 103 | - public function canIdentify() |
|
| 104 | - { |
|
| 100 | + public function canIdentify() { |
|
| 105 | 101 | $oai = Endpoint::build($this->oaiUrl); |
| 106 | 102 | $identity = $oai->identify(); |
| 107 | 103 | |
@@ -114,8 +110,7 @@ discard block |
||
| 114 | 110 | /** |
| 115 | 111 | * @test |
| 116 | 112 | */ |
| 117 | - public function identifyGivesFallbackDatestampWhenNoDocuments() |
|
| 118 | - { |
|
| 113 | + public function identifyGivesFallbackDatestampWhenNoDocuments() { |
|
| 119 | 114 | $oai = Endpoint::build($this->oaiUrlNoStoragePid); |
| 120 | 115 | $identity = $oai->identify(); |
| 121 | 116 | |
@@ -125,8 +120,7 @@ discard block |
||
| 125 | 120 | /** |
| 126 | 121 | * @test |
| 127 | 122 | */ |
| 128 | - public function canListMetadataFormats() |
|
| 129 | - { |
|
| 123 | + public function canListMetadataFormats() { |
|
| 130 | 124 | $oai = Endpoint::build($this->oaiUrl); |
| 131 | 125 | $formats = $oai->listMetadataFormats(); |
| 132 | 126 | |
@@ -141,8 +135,7 @@ discard block |
||
| 141 | 135 | /** |
| 142 | 136 | * @test |
| 143 | 137 | */ |
| 144 | - public function canListRecords() |
|
| 145 | - { |
|
| 138 | + public function canListRecords() { |
|
| 146 | 139 | $oai = Endpoint::build($this->oaiUrl); |
| 147 | 140 | $result = $oai->listRecords('mets'); |
| 148 | 141 | |
@@ -155,8 +148,7 @@ discard block |
||
| 155 | 148 | /** |
| 156 | 149 | * @test |
| 157 | 150 | */ |
| 158 | - public function noRecordsUntil1900() |
|
| 159 | - { |
|
| 151 | + public function noRecordsUntil1900() { |
|
| 160 | 152 | $this->expectException(OaipmhException::class); |
| 161 | 153 | $this->expectExceptionMessage('empty list'); |
| 162 | 154 | |
@@ -169,8 +161,7 @@ discard block |
||
| 169 | 161 | /** |
| 170 | 162 | * @test |
| 171 | 163 | */ |
| 172 | - public function canUseResumptionToken() |
|
| 173 | - { |
|
| 164 | + public function canUseResumptionToken() { |
|
| 174 | 165 | // NOTE: cursor and expirationDate are optional by the specification, |
| 175 | 166 | // but we include them in our implementation |
| 176 | 167 | |
@@ -228,8 +219,7 @@ discard block |
||
| 228 | 219 | /** |
| 229 | 220 | * @test |
| 230 | 221 | */ |
| 231 | - public function noResumptionTokenForCompleteList() |
|
| 232 | - { |
|
| 222 | + public function noResumptionTokenForCompleteList() { |
|
| 233 | 223 | $client = new HttpClient(); |
| 234 | 224 | |
| 235 | 225 | foreach (['ListIdentifiers', 'ListRecords'] as $verb) { |
@@ -251,8 +241,7 @@ discard block |
||
| 251 | 241 | /** |
| 252 | 242 | * @test |
| 253 | 243 | */ |
| 254 | - public function canListAndResumeIdentifiers() |
|
| 255 | - { |
|
| 244 | + public function canListAndResumeIdentifiers() { |
|
| 256 | 245 | $oai = Endpoint::build($this->oaiUrl); |
| 257 | 246 | $result = $oai->listIdentifiers('mets'); |
| 258 | 247 | |
@@ -265,18 +254,15 @@ discard block |
||
| 265 | 254 | $this->assertEquals('oai:de:slub-dresden:db:id-476248086', $record->identifier); |
| 266 | 255 | } |
| 267 | 256 | |
| 268 | - protected function parseUtc(string $dateTime) |
|
| 269 | - { |
|
| 257 | + protected function parseUtc(string $dateTime) { |
|
| 270 | 258 | return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $dateTime); |
| 271 | 259 | } |
| 272 | 260 | |
| 273 | - protected function assertUtcDateString(string $dateTime) |
|
| 274 | - { |
|
| 261 | + protected function assertUtcDateString(string $dateTime) { |
|
| 275 | 262 | $this->assertInstanceOf(DateTime::class, $this->parseUtc($dateTime)); |
| 276 | 263 | } |
| 277 | 264 | |
| 278 | - protected function assertInFuture(string $dateTime) |
|
| 279 | - { |
|
| 265 | + protected function assertInFuture(string $dateTime) { |
|
| 280 | 266 | $this->assertGreaterThan(new DateTime(), $this->parseUtc($dateTime)); |
| 281 | 267 | } |
| 282 | 268 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | class OaiPmhTest extends FunctionalTestCase |
| 16 | 16 | { |
| 17 | - protected $disableJsonWrappedResponse = true; |
|
| 17 | + protected $disableJsonWrappedResponse = TRUE; |
|
| 18 | 18 | |
| 19 | 19 | protected $coreExtensionsToLoad = [ |
| 20 | 20 | 'fluid', |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | protected function setUpOaiSolr() |
| 57 | 57 | { |
| 58 | 58 | // Setup Solr only once for all tests in this suite |
| 59 | - static $solr = null; |
|
| 59 | + static $solr = NULL; |
|
| 60 | 60 | |
| 61 | - if ($solr === null) { |
|
| 61 | + if ($solr === NULL) { |
|
| 62 | 62 | $coreName = Solr::createCore(); |
| 63 | 63 | $solr = Solr::getInstance($coreName); |
| 64 | 64 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->expectExceptionMessage('empty list'); |
| 162 | 162 | |
| 163 | 163 | $oai = Endpoint::build($this->oaiUrl); |
| 164 | - $result = $oai->listRecords('mets', null, (new DateTime())->setDate(1900, 1, 1)); |
|
| 164 | + $result = $oai->listRecords('mets', NULL, (new DateTime())->setDate(1900, 1, 1)); |
|
| 165 | 165 | |
| 166 | 166 | $result->current(); |
| 167 | 167 | } |