@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @var bool |
| 105 | 105 | * @access protected |
| 106 | 106 | */ |
| 107 | - protected $formatsLoaded = false; |
|
| 107 | + protected $formatsLoaded = FALSE; |
|
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * Are there any fulltext files available? This also includes IIIF text annotations |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @var bool |
| 115 | 115 | * @access protected |
| 116 | 116 | */ |
| 117 | - protected $hasFulltext = false; |
|
| 117 | + protected $hasFulltext = FALSE; |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * Last searched logical and physical page |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @var array |
| 123 | 123 | * @access protected |
| 124 | 124 | */ |
| 125 | - protected $lastSearchedPhysicalPage = ['logicalPage' => null, 'physicalPage' => null]; |
|
| 125 | + protected $lastSearchedPhysicalPage = ['logicalPage' => NULL, 'physicalPage' => NULL]; |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * This holds the logical units |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @var bool |
| 149 | 149 | * @access protected |
| 150 | 150 | */ |
| 151 | - protected $metadataArrayLoaded = false; |
|
| 151 | + protected $metadataArrayLoaded = FALSE; |
|
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * The holds the total number of pages |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @var bool |
| 190 | 190 | * @access protected |
| 191 | 191 | */ |
| 192 | - protected $physicalStructureLoaded = false; |
|
| 192 | + protected $physicalStructureLoaded = FALSE; |
|
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * This holds the PID of the document or zero if not in database |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @var bool |
| 215 | 215 | * @access protected |
| 216 | 216 | */ |
| 217 | - protected $ready = false; |
|
| 217 | + protected $ready = FALSE; |
|
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | 220 | * The METS file's / IIIF manifest's record identifier |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @var bool |
| 249 | 249 | * @access protected |
| 250 | 250 | */ |
| 251 | - protected $rootIdLoaded = false; |
|
| 251 | + protected $rootIdLoaded = FALSE; |
|
| 252 | 252 | |
| 253 | 253 | /** |
| 254 | 254 | * This holds the smLinks between logical and physical structMap |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * @var bool |
| 266 | 266 | * @access protected |
| 267 | 267 | */ |
| 268 | - protected $smLinksLoaded = false; |
|
| 268 | + protected $smLinksLoaded = FALSE; |
|
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * This holds the logical structure |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @var bool |
| 283 | 283 | * @access protected |
| 284 | 284 | */ |
| 285 | - protected $tableOfContentsLoaded = false; |
|
| 285 | + protected $tableOfContentsLoaded = FALSE; |
|
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | 288 | * This holds the document's thumbnail location |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | * @var bool |
| 300 | 300 | * @access protected |
| 301 | 301 | */ |
| 302 | - protected $thumbnailLoaded = false; |
|
| 302 | + protected $thumbnailLoaded = FALSE; |
|
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | 305 | * This holds the toplevel structure's "@ID" (METS) or the manifest's "@id" (IIIF) |
@@ -408,17 +408,17 @@ discard block |
||
| 408 | 408 | * |
| 409 | 409 | * @return \Kitodo\Dlf\Common\Doc|null Instance of this class, either MetsDocument or IiifManifest |
| 410 | 410 | */ |
| 411 | - public static function &getInstance($location, $settings = [], $forceReload = false) |
|
| 411 | + public static function &getInstance($location, $settings = [], $forceReload = FALSE) |
|
| 412 | 412 | { |
| 413 | 413 | // Create new instance depending on format (METS or IIIF) ... |
| 414 | - $documentFormat = null; |
|
| 415 | - $xml = null; |
|
| 416 | - $iiif = null; |
|
| 414 | + $documentFormat = NULL; |
|
| 415 | + $xml = NULL; |
|
| 416 | + $iiif = NULL; |
|
| 417 | 417 | |
| 418 | 418 | if ($instance = self::getDocCache($location)) { |
| 419 | 419 | return $instance; |
| 420 | 420 | } else { |
| 421 | - $instance = null; |
|
| 421 | + $instance = NULL; |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | // Try to load a file from the url |
@@ -427,17 +427,17 @@ discard block |
||
| 427 | 427 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
| 428 | 428 | |
| 429 | 429 | $content = Helper::getUrl($location); |
| 430 | - if ($content !== false) { |
|
| 430 | + if ($content !== FALSE) { |
|
| 431 | 431 | $xml = Helper::getXmlFileAsString($content); |
| 432 | - if ($xml !== false) { |
|
| 432 | + if ($xml !== FALSE) { |
|
| 433 | 433 | /* @var $xml \SimpleXMLElement */ |
| 434 | 434 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); |
| 435 | 435 | $xpathResult = $xml->xpath('//mets:mets'); |
| 436 | - $documentFormat = !empty($xpathResult) ? 'METS' : null; |
|
| 436 | + $documentFormat = !empty($xpathResult) ? 'METS' : NULL; |
|
| 437 | 437 | } else { |
| 438 | 438 | // Try to load file as IIIF resource instead. |
| 439 | - $contentAsJsonArray = json_decode($content, true); |
|
| 440 | - if ($contentAsJsonArray !== null) { |
|
| 439 | + $contentAsJsonArray = json_decode($content, TRUE); |
|
| 440 | + if ($contentAsJsonArray !== NULL) { |
|
| 441 | 441 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
| 442 | 442 | IiifHelper::setMaxThumbnailHeight($extConf['iiifThumbnailHeight']); |
| 443 | 443 | IiifHelper::setMaxThumbnailWidth($extConf['iiifThumbnailWidth']); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | * |
| 479 | 479 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
| 480 | 480 | */ |
| 481 | - public abstract function getLogicalStructure($id, $recursive = false); |
|
| 481 | + public abstract function getLogicalStructure($id, $recursive = FALSE); |
|
| 482 | 482 | |
| 483 | 483 | /** |
| 484 | 484 | * This extracts all the metadata for a logical structure node |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | } else { |
| 516 | 516 | $physicalPage = 0; |
| 517 | 517 | foreach ($this->physicalStructureInfo as $page) { |
| 518 | - if (strpos($page['orderlabel'], $logicalPage) !== false) { |
|
| 518 | + if (strpos($page['orderlabel'], $logicalPage) !== FALSE) { |
|
| 519 | 519 | $this->lastSearchedPhysicalPage['logicalPage'] = $logicalPage; |
| 520 | 520 | $this->lastSearchedPhysicalPage['physicalPage'] = $physicalPage; |
| 521 | 521 | return $physicalPage; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | if (!empty($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])) { |
| 567 | 567 | // Get full text file. |
| 568 | 568 | $fileContent = GeneralUtility::getUrl($this->getFileLocation($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])); |
| 569 | - if ($fileContent !== false) { |
|
| 569 | + if ($fileContent !== FALSE) { |
|
| 570 | 570 | $textFormat = $this->getTextFormat($fileContent); |
| 571 | 571 | } else { |
| 572 | 572 | $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"'); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | { |
| 619 | 619 | $xml = Helper::getXmlFileAsString($fileContent); |
| 620 | 620 | |
| 621 | - if ($xml !== false) { |
|
| 621 | + if ($xml !== FALSE) { |
|
| 622 | 622 | // Get the root element's name as text format. |
| 623 | 623 | return strtoupper($xml->getName()); |
| 624 | 624 | } else { |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | * |
| 639 | 639 | * @return string The title of the document itself or a parent document |
| 640 | 640 | */ |
| 641 | - public static function getTitle($uid, $recursive = false) |
|
| 641 | + public static function getTitle($uid, $recursive = FALSE) |
|
| 642 | 642 | { |
| 643 | 643 | $title = ''; |
| 644 | 644 | // Sanitize input. |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | && intval($partof) |
| 672 | 672 | && $partof != $uid |
| 673 | 673 | ) { |
| 674 | - $title = self::getTitle($partof, true); |
|
| 674 | + $title = self::getTitle($partof, TRUE); |
|
| 675 | 675 | } |
| 676 | 676 | } else { |
| 677 | 677 | Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING); |
@@ -732,12 +732,12 @@ discard block |
||
| 732 | 732 | return $depth; |
| 733 | 733 | } elseif (array_key_exists('children', $element)) { |
| 734 | 734 | $foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId); |
| 735 | - if ($foundInChildren !== false) { |
|
| 735 | + if ($foundInChildren !== FALSE) { |
|
| 736 | 736 | return $foundInChildren; |
| 737 | 737 | } |
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | - return false; |
|
| 740 | + return FALSE; |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | /** |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | } else { |
| 811 | 811 | $this->logger->error('Invalid file location "' . $location . '" for document loading'); |
| 812 | 812 | } |
| 813 | - return false; |
|
| 813 | + return FALSE; |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | /** |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | 'class' => $resArray['class'] |
| 858 | 858 | ]; |
| 859 | 859 | } |
| 860 | - $this->formatsLoaded = true; |
|
| 860 | + $this->formatsLoaded = TRUE; |
|
| 861 | 861 | } |
| 862 | 862 | } |
| 863 | 863 | |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | ) { |
| 959 | 959 | $this->prepareMetadataArray($cPid); |
| 960 | 960 | $this->metadataArray[0] = $cPid; |
| 961 | - $this->metadataArrayLoaded = true; |
|
| 961 | + $this->metadataArrayLoaded = TRUE; |
|
| 962 | 962 | } |
| 963 | 963 | return $this->metadataArray; |
| 964 | 964 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | $parent = self::getInstance($this->parentId, ['storagePid' => $this->pid]); |
| 1068 | 1068 | $this->rootId = $parent->rootId; |
| 1069 | 1069 | } |
| 1070 | - $this->rootIdLoaded = true; |
|
| 1070 | + $this->rootIdLoaded = TRUE; |
|
| 1071 | 1071 | } |
| 1072 | 1072 | return $this->rootId; |
| 1073 | 1073 | } |
@@ -1096,8 +1096,8 @@ discard block |
||
| 1096 | 1096 | // Is there no logical structure array yet? |
| 1097 | 1097 | if (!$this->tableOfContentsLoaded) { |
| 1098 | 1098 | // Get all logical structures. |
| 1099 | - $this->getLogicalStructure('', true); |
|
| 1100 | - $this->tableOfContentsLoaded = true; |
|
| 1099 | + $this->getLogicalStructure('', TRUE); |
|
| 1100 | + $this->tableOfContentsLoaded = TRUE; |
|
| 1101 | 1101 | } |
| 1102 | 1102 | return $this->tableOfContents; |
| 1103 | 1103 | } |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | * |
| 1114 | 1114 | * @return string The document's thumbnail location |
| 1115 | 1115 | */ |
| 1116 | - protected abstract function _getThumbnail($forceReload = false); |
|
| 1116 | + protected abstract function _getThumbnail($forceReload = FALSE); |
|
| 1117 | 1117 | |
| 1118 | 1118 | /** |
| 1119 | 1119 | * This returns the ID of the toplevel logical structure node |