Passed
Branch oai_solr_new_directory_structu... (24cd44)
by Erik
02:44
created
common/class.tx_dlf_indexing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             // Handle multi-volume documents.
102 102
             if ($doc->parentId) {
103 103
 
104
-                $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE);
104
+                $parent = & tx_dlf_document::getInstance($doc->parentId, 0, TRUE);
105 105
 
106 106
                 if ($parent->ready) {
107 107
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
             $solrDoc->setField('purl', $metadata['purl'][0]);
597 597
 
598
-            $solrDoc->setField('location',$doc->location);
598
+            $solrDoc->setField('location', $doc->location);
599 599
 
600 600
             $solrDoc->setField('urn', $metadata['urn']);
601 601
 
Please login to merge, or discard this patch.
common/class.tx_dlf_solr.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -539,11 +539,11 @@
 block discarded – undo
539 539
      *
540 540
      * @return	array       The Apache Solr Documents that were fetched
541 541
      */
542
-    public function search_raw($query = '', $parameters = array())
542
+    public function search_raw($query = '', $parameters = array ())
543 543
     {
544
-        $solr_response = $this->service->search((string)$query, 0, $this->limit, array_merge($this->params, $parameters));
544
+        $solr_response = $this->service->search((string) $query, 0, $this->limit, array_merge($this->params, $parameters));
545 545
 
546
-        $searchresult = array();
546
+        $searchresult = array ();
547 547
 
548 548
         foreach ($solr_response->response->docs as $doc) {
549 549
             $searchresult[] = $doc;
Please login to merge, or discard this patch.
common/class.tx_dlf_document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1526,7 +1526,7 @@
 block discarded – undo
1526 1526
 
1527 1527
             if ($parentLocation != $this->location) {
1528 1528
 
1529
-                $parentDoc =& tx_dlf_document::getInstance($parentLocation, $pid);
1529
+                $parentDoc = & tx_dlf_document::getInstance($parentLocation, $pid);
1530 1530
 
1531 1531
                 if ($parentDoc->ready) {
1532 1532
 
Please login to merge, or discard this patch.
common/class.tx_dlf_plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
             $pid = (!empty($this->conf['excludeOther']) ? intval($this->conf['pages']) : 0);
133 133
 
134 134
             // Get instance of tx_dlf_document.
135
-            $this->doc =& tx_dlf_document::getInstance($this->piVars['id'], $pid);
135
+            $this->doc = & tx_dlf_document::getInstance($this->piVars['id'], $pid);
136 136
 
137 137
             if (!$this->doc->ready) {
138 138
 
Please login to merge, or discard this patch.
plugins/oai/class.tx_dlf_oai.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 		if ($GLOBALS['TYPO3_DB']->sql_affected_rows() === -1) {
80 80
 			// Deletion failed.
81
-			$this->devLog('[tx_dlf_oai->deleteExpiredTokens()] Could not delete expired resumption tokens',SYSLOG_SEVERITY_WARNING);
81
+			$this->devLog('[tx_dlf_oai->deleteExpiredTokens()] Could not delete expired resumption tokens', SYSLOG_SEVERITY_WARNING);
82 82
 		}
83 83
 	}
84 84
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
632 632
 			'tx_dlf_documents.tstamp AS tstamp',
633 633
 			'tx_dlf_documents',
634
-			'tx_dlf_documents.pid=' . intval($this->conf['pages']),
634
+			'tx_dlf_documents.pid='.intval($this->conf['pages']),
635 635
 			'',
636 636
 			'tx_dlf_documents.tstamp ASC',
637 637
 			'1'
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			list ($timestamp) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
642 642
 			$earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp);
643 643
 		} else {
644
-			$this->devLog('[tx_dlf_oai->verbIdentify()] No records found with PID "' . $this->conf['pages'] . '"',SYSLOG_SEVERITY_NOTICE);
644
+			$this->devLog('[tx_dlf_oai->verbIdentify()] No records found with PID "'.$this->conf['pages'].'"', SYSLOG_SEVERITY_NOTICE);
645 645
 		}
646 646
 
647 647
 		$linkConf = array (
@@ -653,12 +653,12 @@  discard block
 block discarded – undo
653 653
 		// Add identification node.
654 654
 		$Identify = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'Identify');
655 655
 		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'repositoryName', $repositoryName));
656
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','baseURL', $baseURL));
657
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','protocolVersion', '2.0'));
658
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','adminEmail', $adminEmail));
659
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','earliestDatestamp', $earliestDatestamp));
660
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','deletedRecord', 'transient'));
661
-		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','granularity', 'YYYY-MM-DDThh:mm:ssZ'));
656
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'baseURL', $baseURL));
657
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'protocolVersion', '2.0'));
658
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'adminEmail', $adminEmail));
659
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'earliestDatestamp', $earliestDatestamp));
660
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'deletedRecord', 'transient'));
661
+		$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'granularity', 'YYYY-MM-DDThh:mm:ssZ'));
662 662
 
663 663
 		return $Identify;
664 664
 	}
@@ -892,8 +892,8 @@  discard block
 block discarded – undo
892 892
 			$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
893 893
 				'tx_dlf_collections.index_name AS index_name, tx_dlf_collections.uid AS uid, tx_dlf_collections.index_search as index_query ',
894 894
 				'tx_dlf_collections',
895
-				'tx_dlf_collections.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_collections.oai_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'],
896
-					'tx_dlf_collections') . $where . tx_dlf_helper::whereClause('tx_dlf_collections'),
895
+				'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'],
896
+					'tx_dlf_collections').$where.tx_dlf_helper::whereClause('tx_dlf_collections'),
897 897
 				'',
898 898
 				'',
899 899
 				'1'
@@ -905,10 +905,10 @@  discard block
 block discarded – undo
905 905
 
906 906
 			$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
907 907
 
908
-			if($resArray['index_query'] != "") {
909
-				$solr_query .= '(' . $resArray['index_query'] . ')';
908
+			if ($resArray['index_query'] != "") {
909
+				$solr_query .= '('.$resArray['index_query'].')';
910 910
 			} else {
911
-				$solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"';
911
+				$solr_query .= 'collection:'.'"'.$resArray['index_name'].'"';
912 912
 			}
913 913
 
914 914
 		} else {
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 
920 920
 		// Check for required fields.
921 921
 		foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) {
922
-			$solr_query .= ' NOT ' . $required . ':""';
922
+			$solr_query .= ' NOT '.$required.':""';
923 923
 		}
924 924
 
925 925
 		$from = "*";
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 				$timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1,
934 934
 					$date_array['tm_mday'], $date_array['tm_year'] + 1900);
935 935
 
936
-			   $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) .'.000Z';
936
+			   $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z';
937 937
 
938 938
 			} else {
939 939
 				throw new Exception('badArgument');
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 				$timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1,
952 952
 					$date_array['tm_mday'], $date_array['tm_year'] + 1900);
953 953
 
954
-				$until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z';
954
+				$until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z';
955 955
 
956 956
 				if ($from != "*" && $from > $until) {
957 957
 					throw new Exception('badArgument');
@@ -969,14 +969,14 @@  discard block
 block discarded – undo
969 969
 			}
970 970
 		}
971 971
 
972
-		$solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until .']';
972
+		$solr_query .= ' AND timestamp:['.$from.' TO '.$until.']';
973 973
 
974
-		$documentSet = array();
974
+		$documentSet = array ();
975 975
 
976 976
 		$solr = tx_dlf_solr::getInstance($this->conf['solrcore']);
977 977
 
978 978
 		// We only care about the UID in the results and want them sorted
979
-		$parameters = array("fl" => "uid", "sort" => "uid asc");
979
+		$parameters = array ("fl" => "uid", "sort" => "uid asc");
980 980
 
981 981
 		$result = $solr->search_raw($solr_query, $parameters);
982 982
 
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 			'tx_dlf_documents',
1006 1006
 			'tx_dlf_relations',
1007 1007
 			'tx_dlf_collections',
1008
-			'AND tx_dlf_documents.uid IN (' . implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)) . ') AND tx_dlf_documents.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_collections.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_relations.ident=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations') . tx_dlf_helper::whereClause('tx_dlf_collections'),
1008
+			'AND tx_dlf_documents.uid IN ('.implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)).') AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_collections'),
1009 1009
 			'tx_dlf_documents.uid',
1010 1010
 			'tx_dlf_documents.tstamp',
1011 1011
 			$this->conf['limit']
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 					$metadata = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'metadata');
1054 1054
 
1055 1055
 					$metadataPrefix = $this->piVars['metadataPrefix'];
1056
-					if(!$metadataPrefix) {
1056
+					if (!$metadataPrefix) {
1057 1057
 						// If we resume an action the metadataPrefix is stored with the documentSet
1058 1058
 						$metadataPrefix = $documentListSet->metadata['metadataPrefix'];
1059 1059
 					}
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
 			$GLOBALS['TYPO3_DB']->exec_INSERTquery(
1102 1102
 				'tx_dlf_tokens',
1103
-				array(
1103
+				array (
1104 1104
 					'tstamp' => $GLOBALS['EXEC_TIME'],
1105 1105
 					'token' => $token,
1106 1106
 					'options' => serialize($documentListSet),
@@ -1108,15 +1108,15 @@  discard block
 block discarded – undo
1108 1108
 				)
1109 1109
 			);
1110 1110
 
1111
-			if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
1111
+			if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
1112 1112
 				$resumptionToken->setAttribute('resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8'));
1113 1113
 			} else {
1114
-				$this->devLog('[tx_dlf_oai->verb'. $this->piVars['verb'] .'()] Could not create resumption token', SYSLOG_SEVERITY_ERROR);
1114
+				$this->devLog('[tx_dlf_oai->verb'.$this->piVars['verb'].'()] Could not create resumption token', SYSLOG_SEVERITY_ERROR);
1115 1115
 			}
1116 1116
 		}
1117 1117
 
1118 1118
 		$resumptionToken->setAttribute('cursor', intval($documentListSet->metadata['completeListSize']) - count($documentListSet));
1119
-		$resumptionToken->setAttribute('completeListSize',	$documentListSet->metadata['completeListSize']);
1119
+		$resumptionToken->setAttribute('completeListSize', $documentListSet->metadata['completeListSize']);
1120 1120
 		$resumptionToken->setAttribute('expirationDate', gmdate('Y-m-d\TH:i:s\Z', $GLOBALS['EXEC_TIME'] + $this->conf['expired']));
1121 1121
 
1122 1122
 		return $resumptionToken;
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
 }
1132 1132
 
1133
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php'])	{
1133
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php']) {
1134 1134
 	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php']);
1135 1135
 
1136 1136
 }
Please login to merge, or discard this patch.
modules/indexing/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $this->list->save();
163 163
 
164 164
         // Save document to database and index.
165
-        $doc =& tx_dlf_document::getInstance($uid, 0, TRUE);
165
+        $doc = & tx_dlf_document::getInstance($uid, 0, TRUE);
166 166
 
167 167
         if ($doc->ready) {
168 168
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                         && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($this->data['id'])) {
220 220
 
221 221
                         // Save document to database and index.
222
-                        $doc =& tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE);
222
+                        $doc = & tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE);
223 223
 
224 224
                         if ($doc->ready) {
225 225
 
Please login to merge, or discard this patch.
cli/class.tx_dlf_cli.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 }
90 90
 
91 91
                 // Get the document...
92
-                $doc =& tx_dlf_document::getInstance($this->cli_args['-doc'][0], $this->cli_args['-pid'][0], TRUE);
92
+                $doc = & tx_dlf_document::getInstance($this->cli_args['-doc'][0], $this->cli_args['-pid'][0], TRUE);
93 93
 
94 94
                 if ($doc->ready) {
95 95
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
171 171
 
172 172
                     // Get the document...
173
-                    $doc =& tx_dlf_document::getInstance($resArray['uid'], $this->cli_args['-pid'][0], TRUE);
173
+                    $doc = & tx_dlf_document::getInstance($resArray['uid'], $this->cli_args['-pid'][0], TRUE);
174 174
 
175 175
                     if ($doc->ready) {
176 176
 
Please login to merge, or discard this patch.
hooks/class.tx_dlf_doctype.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
         if (!empty($this->piVars['id'])) {
162 162
 
163 163
             // Get instance of tx_dlf_document.
164
-            $this->doc =& tx_dlf_document::getInstance($this->piVars['id']);
164
+            $this->doc = & tx_dlf_document::getInstance($this->piVars['id']);
165 165
 
166 166
             if (!$this->doc->ready) {
167 167
 
Please login to merge, or discard this patch.
hooks/class.tx_dlf_tcemain.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                             } else {
338 338
 
339 339
                                 // Reindex document.
340
-                                $doc =& tx_dlf_document::getInstance($id);
340
+                                $doc = & tx_dlf_document::getInstance($id);
341 341
 
342 342
                                 if ($doc->ready) {
343 343
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                     case 'undelete':
423 423
 
424 424
                         // Reindex document.
425
-                        $doc =& tx_dlf_document::getInstance($id);
425
+                        $doc = & tx_dlf_document::getInstance($id);
426 426
 
427 427
                         if ($doc->ready) {
428 428
 
Please login to merge, or discard this patch.