r71562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71561‎ | r71562 | r71563 >
Date:14:49, 24 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Documentation and style improvements
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php
@@ -26,6 +26,7 @@
2727 * @ingroup SMWQuery
2828 */
2929 class SMWQueryResult {
 30+
3031 /**
3132 * Array of SMWWikiPageValue objects that are the basis for this result
3233 * @var Array of SMWWikiPageValue
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php
@@ -191,6 +191,8 @@
192192 * processing -- not all DBMS might be able in seeing this by themselves.
193193 *
194194 * @param SMWQuery $query
 195+ *
 196+ * @return mixed: depends on $query->querymode
195197 */
196198 public function getQueryResult( SMWQuery $query ) {
197199 global $smwgIgnoreQueryErrors, $smwgQSortingSupport;
@@ -276,6 +278,8 @@
277279 *
278280 * @param SMWQuery $query
279281 * @param integer $rootid
 282+ *
 283+ * @return string
280284 */
281285 protected function getDebugQueryResult( SMWQuery $query, $rootid ) {
282286 $qobj = $this->m_queries[$rootid];
@@ -331,6 +335,8 @@
332336 *
333337 * @param SMWQuery $query
334338 * @param integer $rootid
 339+ *
 340+ * @return integer
335341 */
336342 protected function getCountQueryResult( SMWQuery $query, $rootid ) {
337343 wfProfileIn( 'SMWSQLStore2Queries::getCountQueryResult (SMW)' );
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php
@@ -215,6 +215,8 @@
216216 * was a usual instance retrieval query. In the case that the query asked for a plain
217217 * string (querymode MODE_COUNT or MODE_DEBUG) a plain wiki and HTML-compatible string
218218 * is returned.
 219+ *
 220+ * @return SMWQueryResult
219221 */
220222 abstract function getQueryResult( SMWQuery $query );
221223
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -578,10 +578,10 @@
579579 }
580580
581581 /**
582 - *
583 - *
584582 * @param SMWPropertyValue $property
585583 * @param SMWRequestOptions $requestoptions
 584+ *
 585+ * @return array
586586 */
587587 public function getAllPropertySubjects( SMWPropertyValue $property, $requestoptions = null ) {
588588 wfProfileIn( "SMWSQLStore2::getAllPropertySubjects (SMW)" );
@@ -970,6 +970,11 @@
971971
972972 ///// Query answering /////
973973
 974+ /**
 975+ * @param $query SMWQuery
 976+ *
 977+ * @return mixed: depends on $query->querymode
 978+ */
974979 function getQueryResult( SMWQuery $query ) {
975980 wfProfileIn( 'SMWSQLStore2::getQueryResult (SMW)' );
976981 global $smwgIP;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -32,7 +32,7 @@
3333 * known. Otherwise it will be determined from the parameters when
3434 * needed. This parameter is just for optimisation in a common case.
3535 */
36 - static public function createQuery( $querystring, $params, $context = SMWQueryProcessor::INLINE_QUERY, $format = '', $extraprintouts = array() ) {
 36+ static public function createQuery( $querystring, array $params, $context = SMWQueryProcessor::INLINE_QUERY, $format = '', $extraprintouts = array() ) {
3737 global $smwgQDefaultNamespaces, $smwgQFeatures, $smwgQConceptFeatures;
3838
3939 // parse query:
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -234,8 +234,11 @@
235235 * wfLoadExtensionMessages function will no longer be needed (or supported).
236236 * This function is used for maintaining compatibility with MediaWiki 1.15 or
237237 * below.
 238+ *
238239 * @param string $extensionName The extension name for finding the the message
239240 * file; same as in wfLoadExtensionMessages()
 241+ *
 242+ * @since 1.5.1
240243 */
241244 function smwfLoadExtensionMessages( $extensionName ) {
242245 if ( function_exists( 'wfLoadExtensionMessages' ) ) {
@@ -249,14 +252,21 @@
250253 * infrastructure allows to set up load balancing and task-dependent use of
251254 * stores (e.g. using other stores for fast querying than for storing new
252255 * facts), somewhat similar to MediaWiki's DB implementation.
 256+ *
 257+ * @return SMWStore
253258 */
254259 function &smwfGetStore() {
255260 global $smwgMasterStore, $smwgDefaultStore, $smwgIP;
256 - if ( $smwgDefaultStore == 'SMWRAPStore2' ) { // no autoloading for RAP store, since autoloaded classes are in rare cases loaded by MW even if not used in code -- this is not possible for RAPstore, which depends on RAP being installed
 261+
 262+ // No autoloading for RAP store, since autoloaded classes are in rare cases loaded by MW even if not used in code.
 263+ // This is not possible for RAPstore, which depends on RAP being installed.
 264+ if ( $smwgDefaultStore == 'SMWRAPStore2' ) {
257265 include_once( $smwgIP . 'includes/storage/SMW_RAPStore2.php' );
258266 }
 267+
259268 if ( $smwgMasterStore === null ) {
260269 $smwgMasterStore = new $smwgDefaultStore();
261270 }
 271+
262272 return $smwgMasterStore;
263 -}
 273+}
\ No newline at end of file

Status & tagging log