r96746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96745‎ | r96746 | r96747 >
Date:21:29, 10 September 2011
Author:reedy
Status:deferred
Tags:
Comment:
Fix some variable typos

Add some FIXME comments where variables are undefined
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryParser.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Types.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_RDFXML.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_Turtle.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase4Store.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SqlStore2IdCache.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUI.php
@@ -93,7 +93,7 @@
9494 }
9595
9696 // Make sure locally collected output data is pushed to the output:
97 - SMWOutputs::commitToOutputPage( $wgOut );
 97+ SMWOutputs::commitToOutputPage( $wgOut );
9898 }
9999
100100 /**
@@ -1413,7 +1413,7 @@
14141414 * @global boolean $smwgQSortingSupport
14151415 * @global WebRequest $wgRequest
14161416 * @return string
1417 - *
 1417+ *
14181418 * @todo This code is not used anywhere in SMW.
14191419 */
14201420 protected function getSortingFormBox() {
@@ -1447,7 +1447,7 @@
14481448 $this->setUrlArgs( $urlArgs );
14491449 }
14501450
1451 - $hidden .= '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" size="25" />' . "\n";
 1451+ $hidden = '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" size="25" />' . "\n";
14521452 $hidden .= ' <select name="order_num">' . "\n";
14531453 $hidden .= ' <option value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . "</option>\n";
14541454 $hidden .= ' <option value="DESC">' . wfMsg( 'smw_qui_descorder' ) . "</option>\n</select>\n";
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_RDFXML.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SMWRDFXMLSerializer class that provides basic functions for
6 - * serialising OWL data in RDF/XML syntax.
 6+ * serialising OWL data in RDF/XML syntax.
77 *
88 * @file SMW_Serializer.php
99 * @ingroup SMW
@@ -12,7 +12,7 @@
1313
1414 /**
1515 * Class for serializing exported data (encoded as SMWExpData object) in
16 - * RDF/XML.
 16+ * RDF/XML.
1717 *
1818 * @ingroup SMW
1919 */
@@ -20,7 +20,7 @@
2121 /**
2222 * True if the $pre_ns_buffer contains the beginning of a namespace
2323 * declaration block to which further declarations for the current
24 - * context can be appended.
 24+ * context can be appended.
2525 */
2626 protected $namespace_block_started;
2727 /**
@@ -70,7 +70,7 @@
7171 $this->post_ns_buffer .= "\t<!-- Created by Semantic MediaWiki, http://semantic-mediawiki.org/ -->\n";
7272 $this->post_ns_buffer .= '</rdf:RDF>';
7373 }
74 -
 74+
7575 public function serializeDeclaration( $uri, $typename ) {
7676 $this->post_ns_buffer .= "\t<$typename rdf:about=\"$uri\" />\n";
7777 }
@@ -91,7 +91,7 @@
9292 $this->namespace_block_started = false;
9393 return $result;
9494 }
95 -
 95+
9696 protected function serializeNamespace( $shortname, $uri ) {
9797 if ( $this->namespaces_are_global ) {
9898 $this->global_namespaces[$shortname] = true;
@@ -197,7 +197,7 @@
198198 protected function serializeExpResource( SMWExpNsResource $expResourceProperty, SMWExpResource $expResource, $indent, $isClassTypeProp ) {
199199 $this->post_ns_buffer .= $indent . '<' . $expResourceProperty->getQName();
200200 if ( !$expResource->isBlankNode() ) {
201 - if ( ( $expResource instanceof SMWExpNsResource ) && ( $expResource->getNamespaceID() == 'wiki' ) ) {
 201+ if ( ( $expResource instanceof SMWExpNsResource ) && ( $expResource->getNamespaceID() == 'wiki' ) ) {
202202 // very common case, reduce bandwidth
203203 $this->post_ns_buffer .= ' rdf:resource="&wiki;' . $expResource->getLocalName() . '"';
204204 } else {
@@ -229,14 +229,15 @@
230230 $this->serializeExpResource( $expResourceProperty, $expElement, $indent );
231231 }
232232 if ( $isClassTypeProp ) {
 233+ // FIXME: $expResource is undefined
233234 $this->requireDeclaration( $expResource, SMW_SERIALIZER_DECL_CLASS );
234235 }
235236 }
236237 $this->post_ns_buffer .= "$indent</" . $expResourceProperty->getQName() . ">\n";
237238 }
238 -
 239+
239240 /**
240 - * Escape a string in the special form that is required for values in
 241+ * Escape a string in the special form that is required for values in
241242 * DTD entity declarations in XML. Namely, this require the percent sign
242243 * to be replaced.
243244 *
@@ -250,7 +251,7 @@
251252 /**
252253 * Escape a string as required for using it in XML attribute values.
253254 *
254 - * @param $string string to be escaped
 255+ * @param $string string to be escaped
255256 * @return string
256257 */
257258 protected function makeAttributeValueString( $string ) {
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_Turtle.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SMWTurtleSerializer class that provides basic functions for
6 - * serialising OWL data in Turtle syntax.
 6+ * serialising OWL data in Turtle syntax.
77 *
88 * @file SMW_Serializer.php
99 * @ingroup SMW
@@ -12,7 +12,7 @@
1313
1414 /**
1515 * Class for serializing exported data (encoded as SMWExpData object) in
16 - * Turtle syntax.
 16+ * Turtle syntax.
1717 *
1818 * @ingroup SMW
1919 */
@@ -88,7 +88,7 @@
8989 // In this case, one can always use wiki:... followed by "_" and possibly some namespace, since _ is legal as a first character.
9090 "@prefix wiki: <" . SMWExporter::expandURI( '&wiki;' ) . "> .\n" .
9191 "@prefix property: <" . SMWExporter::expandURI( '&property;' ) . "> .\n" .
92 - "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" . // note that this XSD URI is hardcoded below (its unlikely to change, of course)
 92+ "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" . // note that this XSD URI is hardcoded below (its unlikely to change, of course)
9393 "@prefix wikiurl: <" . SMWExporter::expandURI( '&wikiurl;' ) . "> .\n";
9494 }
9595 $this->global_namespaces = array( 'rdf' => true, 'rdfs' => true, 'owl' => true, 'swivt' => true, 'wiki' => true, 'property' => true );
@@ -100,7 +100,7 @@
101101 $this->post_ns_buffer .= "\n# Created by Semantic MediaWiki, http://semantic-mediawiki.org/\n";
102102 }
103103 }
104 -
 104+
105105 public function serializeDeclaration( $uri, $typename ) {
106106 $this->post_ns_buffer .= "<" . SMWExporter::expandURI( $uri ) . "> rdf:type $typename .\n";
107107 }
@@ -112,7 +112,7 @@
113113 }
114114 $this->serializeNamespaces();
115115 }
116 -
 116+
117117 protected function serializeNamespace( $shortname, $uri ) {
118118 $this->global_namespaces[$shortname] = true;
119119 if ( $this->sparqlmode ) {
@@ -141,7 +141,7 @@
142142 $bnode = true;
143143 $this->post_ns_buffer .= "[";
144144 }
145 -
 145+
146146 if ( ( $indent != '' ) && ( !$bnode ) ) { // called to generate a nested descripion; but Turtle cannot nest non-bnode descriptions, do this later
147147 $this->subexpdata[] = $data;
148148 return;
@@ -165,7 +165,7 @@
166166 if ( $value instanceof SMWExpLiteral ) {
167167 $prop_decl_type = SMW_SERIALIZER_DECL_APROP;
168168 $this->serializeExpLiteral( $value );
169 - } elseif ( $value instanceof SMWExpResource ) {
 169+ } elseif ( $value instanceof SMWExpResource ) {
170170 $prop_decl_type = SMW_SERIALIZER_DECL_OPROP;
171171 $this->serializeExpResource( $value );
172172 } elseif ( $value instanceof SMWExpData ) { // resource (maybe blank node), could have subdescriptions
@@ -182,6 +182,7 @@
183183 $this->post_ns_buffer .= " )";
184184 } else {
185185 if ( $class_type_prop ) {
 186+ // FIXME: $object is undefined
186187 $this->requireDeclaration( $object, SMW_SERIALIZER_DECL_CLASS );
187188 }
188189 if ( count( $value->getProperties() ) > 0 ) { // resource with data: serialise
@@ -201,11 +202,11 @@
202203 }
203204 $this->post_ns_buffer .= ( $bnode ? " ]" : " ." ) . ( $indent == '' ? "\n\n" : '' );
204205 }
205 -
 206+
206207 protected function serializeExpLiteral( SMWExpLiteral $element ) {
207208 $this->post_ns_buffer .= self::getTurtleNameForExpElement( $element );
208209 }
209 -
 210+
210211 protected function serializeExpResource( SMWExpResource $element ) {
211212 if ( $element instanceof SMWExpNsResource ) {
212213 $this->requireNamespace( $element->getNamespaceID(), $element->getNamespace() );
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Types.php
@@ -81,8 +81,8 @@
8282 * @return boolean
8383 */
8484 protected function loadDataItem( SMWDataItem $dataItem ) {
85 - if ( ( $dataItem instanceof SMWDIUri ) && ( $dataItem->getScheme() == 'http' ) &&
86 - ( $dataItem->getHierpart() == '//semantic-mediawiki.org/swivt/1.0' ) &&
 85+ if ( ( $dataItem instanceof SMWDIUri ) && ( $dataItem->getScheme() == 'http' ) &&
 86+ ( $dataItem->getHierpart() == '//semantic-mediawiki.org/swivt/1.0' ) &&
8787 ( $dataItem->getQuery() == '' ) ) {
8888 $this->m_isAlias = false;
8989 $this->m_typeId = $dataItem->getFragment();
@@ -106,12 +106,12 @@
107107 }
108108 }
109109
110 - public function getShortHTMLText( $linker = null ) {
 110+ public function getShortHTMLText( $linked = null ) {
111111 if ( ( $linked === null ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption == '' ) ) {
112112 return htmlspecialchars( $this->m_caption );
113113 } else {
114114 $title = Title::makeTitle( NS_SPECIAL, $this->getSpecialPageTitleText() );
115 - return $linker->makeLinkObj( $title, htmlspecialchars( $this->m_caption ) );
 115+ return $linked->makeLinkObj( $title, htmlspecialchars( $this->m_caption ) );
116116 }
117117 }
118118
@@ -134,15 +134,15 @@
135135 return $linker->makeLinkObj( $title, htmlspecialchars( $this->m_realLabel ) );
136136 }
137137 }
138 -
 138+
139139 /**
140140 * Gets the title text for the types special page.
141141 * Takes care of compatibility changes in MW 1.17 and 1.18.
142142 * 1.17 introduces SpecialPageFactory
143143 * 1.18 deprecates SpecialPage::getLocalNameFor
144 - *
 144+ *
145145 * @since 1.6
146 - *
 146+ *
147147 * @return string
148148 */
149149 protected function getSpecialPageTitleText() {
@@ -161,7 +161,7 @@
162162
163163 /**
164164 * This class uses type ids as DB keys.
165 - *
 165+ *
166166 * @return string
167167 */
168168 public function getDBkey() {
@@ -181,7 +181,7 @@
182182 /**
183183 * Is this an alias for another datatype in SMW? This information is used to
184184 * explain entries in Special:Types that are found since they have pages.
185 - *
 185+ *
186186 * @return boolean
187187 */
188188 public function isAlias() {
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryParser.php
@@ -22,7 +22,7 @@
2323 protected $m_categoryprefix; // cache label of category namespace . ':'
2424 protected $m_conceptprefix; // cache label of concept namespace . ':'
2525 protected $m_categoryPrefixCannonical; // cache canonnical label of category namespace . ':'
26 - protected $m_conceptPrefixCannonical; // cache canonnical label of concept namespace . ':'
 26+ protected $m_conceptPrefixCannonical; // cache canonnical label of concept namespace . ':'
2727 protected $m_queryfeatures; // query features to be supported, format similar to $smwgQFeatures
2828
2929 public function __construct( $queryfeatures = false ) {
@@ -31,8 +31,8 @@
3232 $this->m_categoryprefix = $wgContLang->getNsText( NS_CATEGORY ) . ':';
3333 $this->m_conceptprefix = $wgContLang->getNsText( SMW_NS_CONCEPT ) . ':';
3434 $this->m_categoryPrefixCannonical = 'Category:';
35 - $this->m_conceptPrefixCannonical = 'Concept:';
36 -
 35+ $this->m_conceptPrefixCannonical = 'Concept:';
 36+
3737 $this->m_defaultns = null;
3838 $this->m_queryfeatures = $queryfeatures === false ? $smwgQFeatures : $queryfeatures;
3939 }
@@ -305,6 +305,7 @@
306306
307307 foreach ( $propertynames as $name ) {
308308 if ( $typeid != '_wpg' ) { // non-final property in chain was no wikipage: not allowed
 309+ // FIXME: $prevname is undefined
309310 $this->m_errors[] = wfMsgForContent( 'smw_valuesubquery', $prevname );
310311 return null; ///TODO: read some more chunks and try to finish [[ ]]
311312 }
@@ -432,7 +433,7 @@
433434 }
434435 if ( ( count( $list ) == 2 ) && ( $list[1] == '+' ) ) { // try namespace restriction
435436 global $wgContLang;
436 -
 437+
437438 $idx = $wgContLang->getNsIndex( str_replace( ' ', '_', $list[0] ) );
438439
439440 if ( $idx !== false ) {
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php
@@ -1,17 +1,17 @@
22 <?php
33 /**
44 * Base classes for SMW's binding to SPARQL stores.
5 - *
 5+ *
66 * @file
77 * @ingroup SMWSparql
8 - *
 8+ *
99 * @author Markus Krötzsch
1010 */
1111
1212 /**
1313 * This group contains all parts of SMW that relate to communication with
1414 * storage backends and clients via SPARQL.
15 - *
 15+ *
1616 * @defgroup SMWSparql SWMSparql
1717 * @ingroup SMW
1818 */
@@ -50,7 +50,7 @@
5151 * @var integer
5252 */
5353 public $errorCode;
54 -
 54+
5555 /**
5656 * Constructor that creates an error message based on the given data.
5757 *
@@ -83,7 +83,7 @@
8484 $message = "A SPARQL query error has occurred\n" .
8585 "Query: $queryText\n" .
8686 "Error: $errorName\n" .
87 - "Endpoint: $endpoint\n" .
 87+ "Endpoint: $endpoint\n" .
8888 "HTTP response code: $httpCode\n";
8989
9090 parent::__construct( $message );
@@ -95,9 +95,9 @@
9696
9797 /**
9898 * Basic database connector for exchanging data via SPARQL.
99 - *
 99+ *
100100 * @ingroup SMWSparql
101 - *
 101+ *
102102 * @author Markus Krötzsch
103103 */
104104 class SMWSparqlDatabase {
@@ -323,7 +323,7 @@
324324 * in SMW to delete subobjects with all their data. Some RDF stores fail
325325 * on complex delete queries, hence a wrapper function is provided to
326326 * allow more pedestrian implementations.
327 - *
 327+ *
328328 * The function declares the standard namespaces wiki, swivt, rdf, owl,
329329 * rdfs, property, xsd, so these do not have to be included in
330330 * $extraNamespaces.
@@ -430,6 +430,7 @@
431431 */
432432 public function doUpdate( $sparql ) {
433433 if ( $this->m_updateEndpoint == '' ) {
 434+ // FIXME: $error is undefined
434435 throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, $sparql, 'not specified', $error );
435436 }
436437 curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_updateEndpoint );
@@ -454,7 +455,7 @@
455456 * SMWSparqlDatabase::throwSparqlErrors(). If errors occur and this
456457 * method does not throw anything, then an empty result with an error
457458 * code is returned.
458 - *
 459+ *
459460 * @note This method has not been tesetd sufficiently since 4Store uses
460461 * another post encoding. To avoid using it, simply do not provide a
461462 * data endpoint URL when configuring the SPARQL database.
@@ -464,6 +465,7 @@
465466 */
466467 public function doHttpPost( $payload ) {
467468 if ( $this->m_dataEndpoint == '' ) {
 469+ // FIXME: $error is undefined
468470 throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified', $error );
469471 }
470472 curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint );
@@ -472,9 +474,9 @@
473475 // POST as file (fails in 4Store)
474476 $payloadFile = tmpfile();
475477 fwrite( $payloadFile, $payload );
476 - fseek( $payloadFile, 0 );
 478+ fseek( $payloadFile, 0 );
477479 curl_setopt( $this->m_curlhandle, CURLOPT_INFILE, $payloadFile );
478 - curl_setopt( $this->m_curlhandle, CURLOPT_INFILESIZE, strlen( $payload ) );
 480+ curl_setopt( $this->m_curlhandle, CURLOPT_INFILESIZE, strlen( $payload ) );
479481 curl_setopt( $this->m_curlhandle, CURLOPT_HTTPHEADER, array( 'Content-Type: application/x-turtle' ) );
480482
481483 curl_exec( $this->m_curlhandle );
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase4Store.php
@@ -1,19 +1,19 @@
22 <?php
33 /**
44 * 4Store specific adjustments for SMWSparqlDatabase
5 - *
 5+ *
66 * @file
77 * @ingroup SMWSparql
8 - *
 8+ *
99 * @author Markus Krötzsch
1010 */
1111
1212 /**
1313 * Specific modifications of the SPARQL database implementation for 4Store.
14 - *
 14+ *
1515 * @since 1.6
1616 * @ingroup SMWSparql
17 - *
 17+ *
1818 * @author Markus Krötzsch
1919 */
2020 class SMWSparqlDatabase4Store extends SMWSparqlDatabase {
@@ -88,7 +88,7 @@
8989 * SMWSparqlDatabase::throwSparqlErrors(). If errors occur and this
9090 * method does not throw anything, then an empty result with an error
9191 * code is returned.
92 - *
 92+ *
9393 * This method is specific to 4Store since it uses POST parameters that
9494 * are not given in the specification.
9595 *
@@ -97,6 +97,7 @@
9898 */
9999 public function doHttpPost( $payload ) {
100100 if ( $this->m_dataEndpoint == '' ) {
 101+ // FIXME: $error is undefined
101102 throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified', $error );
102103 }
103104 curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint );
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php
@@ -98,7 +98,7 @@
9999 }
100100
101101 /**
102 - * Represents a condition that matches everything. Weak conditions (see
 102+ * Represents a condition that matches everything. Weak conditions (see
103103 * SMWSparqlCondition::$weakConditions) might be still be included to
104104 * enable ordering (selecting sufficient data to order by).
105105 *
@@ -544,8 +544,8 @@
545545 if ( $matchElement instanceof SMWExpNsResource ) {
546546 $namespaces[$matchElement->getNamespaceId()] = $matchElement->getNamespace();
547547 }
548 -
549 - if ( ( $singletonMatchElement !== null ) &&
 548+ // FIXME: $singletonMatchElementName is undefined
 549+ if ( ( $singletonMatchElement !== null ) &&
550550 ( $singletonMatchElementName !== $matchElementName ) ) {
551551 return new SMWSparqlFalseCondition();
552552 }
@@ -669,7 +669,7 @@
670670 if ( array_key_exists( $diProperty->getKey(), $this->m_sortkeys ) ) {
671671 $innerOrderByProperty = $diProperty;
672672 } else {
673 - $innerOrderByProperty = null;
 673+ $innerOrderByProperty = null;
674674 }
675675
676676 //*** Prepare inner condition ***//
@@ -799,7 +799,7 @@
800800 case SMW_CMP_LESS: $comparator = '<'; break;
801801 case SMW_CMP_GRTR: $comparator = '>'; break;
802802 case SMW_CMP_LEQ: $comparator = '<='; break;
803 - case SMW_CMP_GEQ: $comparator = '>='; break;
 803+ case SMW_CMP_GEQ: $comparator = '>='; break;
804804 case SMW_CMP_NEQ: $comparator = '!='; break;
805805 case SMW_CMP_LIKE: $comparator = 'regex'; break;
806806 case SMW_CMP_NLKE: $comparator = '!regex'; break;
@@ -822,7 +822,7 @@
823823 $dataItem->getString() ) . '$';
824824 $result = new SMWSparqlFilterCondition( "$comparator( ?$joinVariable, \"$pattern\", \"s\")", array() );
825825 $this->addOrderByDataForProperty( $result, $joinVariable, $orderByProperty, $dataItem->getDIType() );
826 - } else {
 826+ } else {
827827 $result = $this->buildTrueCondition( $joinVariable, $orderByProperty );
828828 }
829829 } else {
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php
@@ -1,10 +1,10 @@
22 <?php
33 /**
44 * Basic abstract classes for SMW's storage abstraction layer.
5 - *
 5+ *
66 * @file
77 * @ingroup SMWStore
8 - *
 8+ *
99 * @author Markus Krötzsch
1010 */
1111
@@ -12,7 +12,7 @@
1313 * This group contains all parts of SMW that relate to storing and retrieving
1414 * semantic data. SMW components that relate to semantic querying only have
1515 * their own group.
16 - *
 16+ *
1717 * @defgroup SMWStore SMWStore
1818 * @ingroup SMW
1919 */
@@ -21,9 +21,9 @@
2222 * Small data container class for describing filtering conditions on the string
2323 * label of some entity. States that a given string should either be prefix,
2424 * postfix, or some arbitrary part of labels.
25 - *
 25+ *
2626 * @ingroup SMWStore
27 - *
 27+ *
2828 * @author Markus Krötzsch
2929 */
3030 class SMWStringCondition {
@@ -56,9 +56,9 @@
5757 * to their more complex structure.
5858 * Options that should not be used or where default values should be used
5959 * can be left as initialised.
60 - *
 60+ *
6161 * @ingroup SMWStore
62 - *
 62+ *
6363 * @author Markus Krötzsch
6464 */
6565 class SMWRequestOptions {
@@ -110,7 +110,7 @@
111111
112112 /**
113113 * Set a new string condition applied to labels of results (if available).
114 - *
 114+ *
115115 * @param $string string to match
116116 * @param $condition integer type of condition, one of STRCOND_PRE, STRCOND_POST, STRCOND_MID
117117 */
@@ -133,10 +133,10 @@
134134 * semantic store. Besides the relevant interface, this class provides default
135135 * implementations for some optional methods, which inform the caller that
136136 * these methods are not implemented.
137 - *
 137+ *
138138 * @ingroup SMWStore
139 - *
140 - * @author Markus Krötzsch
 139+ *
 140+ * @author Markus Krötzsch
141141 */
142142 abstract class SMWStore {
143143
@@ -187,7 +187,7 @@
188188 /**
189189 * Get an array of all properties for which the given subject has some
190190 * value. The result is an array of SMWDIProperty objects.
191 - *
 191+ *
192192 * @param $subject SMWDIWikiPage denoting the subject
193193 * @param $requestoptions SMWRequestOptions optionally defining further options
194194 */
@@ -213,7 +213,7 @@
214214 */
215215 public function getWikiPageSortKey( SMWDIWikiPage $wikiPage ) {
216216 $sortkeyDataItems = $this->getPropertyValues( $wikiPage, new SMWDIProperty( '_SKEY' ) );
217 -
 217+
218218 if ( count( $sortkeyDataItems ) > 0 ) {
219219 return end( $sortkeyDataItems )->getString();
220220 } else {
@@ -241,7 +241,7 @@
242242 throw new InvalidArgumentException( 'SMWStore::getRedirectTarget() expects an object of type SMWDIProperty or SMWDIWikiPage.' );
243243 }
244244
245 - $redirectDataItems = $this->getPropertyValues( $wikiPage, new SMWDIProperty( '_REDI' ) );
 245+ $redirectDataItems = $this->getPropertyValues( $wikipage, new SMWDIProperty( '_REDI' ) );
246246 if ( count( $redirectDataItems ) > 0 ) {
247247 if ( $dataItem->getDIType() == SMWDataItem::TYPE_PROPERTY ) {
248248 return new SMWDIProperty( end( $redirectDataItems )->getDBkey() );
@@ -280,7 +280,7 @@
281281 * for one particular subject.
282282 *
283283 * @param $data SMWSemanticData
284 - */
 284+ */
285285 public function updateData( SMWSemanticData $data ) {
286286 wfRunHooks( 'SMWStore::updateDataBefore', array( $this, $data ) );
287287
@@ -307,7 +307,7 @@
308308
309309 /**
310310 * Clear all semantic data specified for some page.
311 - *
 311+ *
312312 * @param SMWDIWikiPage $di
313313 */
314314 public function clearData( SMWDIWikiPage $di ) {
@@ -348,9 +348,9 @@
349349 * result is an array of arrays, each containing a property title and a
350350 * count. The expected order is alphabetical w.r.t. to property title
351351 * texts.
352 - *
 352+ *
353353 * @param SMWRequestOptions $requestoptions
354 - *
 354+ *
355355 * @return array
356356 */
357357 public abstract function getPropertiesSpecial( $requestoptions = null );
@@ -360,9 +360,9 @@
361361 * are not used on any page. Stores might restrict here to those
362362 * properties that have been given a type if they have no efficient
363363 * means of accessing the set of all pages in the property namespace.
364 - *
 364+ *
365365 * @param SMWRequestOptions $requestoptions
366 - *
 366+ *
367367 * @return array of SMWDIProperty
368368 */
369369 public abstract function getUnusedPropertiesSpecial( $requestoptions = null );
@@ -372,9 +372,9 @@
373373 * have any page describing them. Stores that have no efficient way of
374374 * accessing the set of all existing pages can extend this list to all
375375 * properties that are used but do not have a type assigned to them.
376 - *
 376+ *
377377 * @param SMWRequestOptions $requestoptions
378 - *
 378+ *
379379 * @return array of array( SMWDIProperty, int )
380380 */
381381 public abstract function getWantedPropertiesSpecial( $requestoptions = null );
@@ -385,7 +385,7 @@
386386 * - 'PROPUSES': Number of property instances (value assignments) in the datatbase
387387 * - 'USEDPROPS': Number of properties that are used with at least one value
388388 * - 'DECLPROPS': Number of properties that have been declared (i.e. assigned a type)
389 - *
 389+ *
390390 * @return array
391391 */
392392 public abstract function getStatistics();
@@ -406,7 +406,7 @@
407407 * timeouts during long operations. All output must be valid in an HTML
408408 * context, but should preferrably be plain text, possibly with some
409409 * linebreaks and weak markup.
410 - *
 410+ *
411411 * @param boolean $verbose
412412 */
413413 public abstract function setup( $verbose = true );
@@ -414,7 +414,7 @@
415415 /**
416416 * Drop (delete) all storage structures created by setup(). This will
417417 * delete all semantic data and possibly leave the wiki uninitialised.
418 - *
 418+ *
419419 * @param boolean $verbose
420420 */
421421 public abstract function drop( $verbose = true );
@@ -438,12 +438,12 @@
439439 * The optional parameter $usejobs indicates whether updates should be
440440 * processed later using MediaWiki jobs, instead of doing all updates
441441 * immediately. The default is TRUE.
442 - *
 442+ *
443443 * @param $index integer
444444 * @param $count integer
445445 * @param $namespaces mixed array or false
446446 * @param $usejobs boolean
447 - *
 447+ *
448448 * @return decimal between 0 and 1 to indicate the overall progress of the refreshing
449449 */
450450 public abstract function refreshData( &$index, $count, $namespaces = false, $usejobs = true );
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SqlStore2IdCache.php
@@ -12,7 +12,7 @@
1313
1414 /**
1515 * An in-memory cache for managing object ids in SMWSQLStore2.
16 - *
 16+ *
1717 * @since 1.6
1818 *
1919 * @ingroup SMWStore
@@ -48,6 +48,7 @@
4949 $this->m_data[$hashKey] = $row->smw_id;
5050 return $row->smw_id;
5151 } else {
 52+ // FIXME: $index is undefined
5253 $index->data[$hashKey] = 0;
5354 return 0;
5455 }