Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -31,6 +31,8 @@ |
32 | 32 | * The format string is used to specify the output format if already |
33 | 33 | * known. Otherwise it will be determined from the parameters when |
34 | 34 | * needed. This parameter is just for optimisation in a common case. |
| 35 | + * |
| 36 | + * @return SMWQuery |
35 | 37 | */ |
36 | 38 | static public function createQuery( $querystring, array $params, $context = SMWQueryProcessor::INLINE_QUERY, $format = '', $extraprintouts = array() ) { |
37 | 39 | global $smwgQDefaultNamespaces, $smwgQFeatures, $smwgQConceptFeatures; |
— | — | @@ -263,12 +265,13 @@ |
264 | 266 | $format = SMWQueryProcessor::getResultFormat( $params ); |
265 | 267 | $query = SMWQueryProcessor::createQuery( $querystring, $params, $context, $format, $extraprintouts ); |
266 | 268 | $result = SMWQueryProcessor::getResultFromQuery( $query, $params, $extraprintouts, $outputmode, $context, $format ); |
| 269 | + |
267 | 270 | wfProfileOut( 'SMWQueryProcessor::getResultFromQueryString (SMW)' ); |
268 | 271 | |
269 | 272 | return $result; |
270 | 273 | } |
271 | 274 | |
272 | | - static public function getResultFromQuery( $query, array $params, $extraprintouts, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '' ) { |
| 275 | + static public function getResultFromQuery( SMWQuery $query, array $params, $extraprintouts, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '' ) { |
273 | 276 | wfProfileIn( 'SMWQueryProcessor::getResultFromQuery (SMW)' ); |
274 | 277 | |
275 | 278 | // Query routing allows extensions to provide alternative stores as data sources |
— | — | @@ -276,8 +279,8 @@ |
277 | 280 | ///TODO: case-insensitive |
278 | 281 | global $smwgQuerySources; |
279 | 282 | |
280 | | - if ( array_key_exists( "source", $params ) && array_key_exists( $params["source"], $smwgQuerySources ) ) { |
281 | | - $store = new $smwgQuerySources[$params["source"]](); |
| 283 | + if ( array_key_exists( 'source', $params ) && array_key_exists( $params['source'], $smwgQuerySources ) ) { |
| 284 | + $store = new $smwgQuerySources[$params['source']](); |
282 | 285 | $query->params = $params; // this is a hack |
283 | 286 | } else { |
284 | 287 | $store = smwfGetStore(); // default store |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | * called during SMW initialisation. Note that parser hooks are something different |
187 | 187 | * than MW hooks in general, which explains the two-level registration. |
188 | 188 | */ |
189 | | - public static function registerParserFunctions( &$parser ) { |
| 189 | + public static function registerParserFunctions( Parser &$parser ) { |
190 | 190 | $parser->setFunctionHook( 'ask', array( 'SMWParserExtensions', 'doAsk' ) ); |
191 | 191 | $parser->setFunctionHook( 'show', array( 'SMWParserExtensions', 'doShow' ) ); |
192 | 192 | $parser->setFunctionHook( 'info', array( 'SMWParserExtensions', 'doInfo' ) ); |