HomePhabricator

Updated mediawiki/extensions Project: mediawiki/extensions/SemanticMediaWiki…

Authored by mkroetzsch.

Description

Updated mediawiki/extensions Project: mediawiki/extensions/SemanticMediaWiki 04220a906e94ea20861b6fa24cd49cf4b0b4e60a null Fixed broken Special:PageProperty

This not-so-often used special page was severely broken, due to two problems:

  • Parameter parsing assume WebRequest::getVal to return '' for empty parameters, but null is returned.
  • The navigation bar generation used = instead of .= for adding the Next link, thus destroying most of the navigation bar.

Have not tried to clean up the rest of the code. It is ugly but short.

Change-Id: I7df5be8b729a2ea0b05eb74762611b22b4c45575

Fixed concept cache creation for SQLStore3

Concept caching did not work with Store3 since it was disabled explicitly (easy to fix) and since concept DIs were not read correctly frmo the database. To address the latter, it is necessary to distinguish fields in the DI table from fields that should be retrieved when fetching the DI from the DB (because the concept table has two extra fields that are not relevant to DI creation). Now all DI handlers specify which information should be fetched from the DB to build their DIs, and since this is often just one row, the DI creation allows the use of a string instead of an array that contains a single string only. This safes memory, which is the main goal in this mechanism.

Concrete changes:

  • All DIHandlers have a method getFetchFields() that works like getTableFields() but only for fields whose contents is needed to create the DI.
  • The SQLStore3Reader uses these fields instead of the table fields to fetch semantic data
  • The SQLStoreReader uses plain strings instead of arrays whenever only one value is fetched
  • The DIHandlers slightly change their dataItemFromDBKeys() implementations to use plain strings instead of arrays if only one key is needed. Checks are added to make sure that we never mistake an array for a string or vice versa (no PHP warnings even on unusual circumstances).
  • Minor documentation and style updates in the affected methods/files.

Change-Id: I3f8589b5bc8210d3866e07a9bfe8bdd513ec2688

Details

Committed
Gerrit Code ReviewNov 5 2012, 6:12 PM
Parents
rMEXTd33770b9381b: Updated mediawiki/extensions Project: mediawiki/extensions/SemanticMediaWiki…
Branches
Unknown
Tags
Unknown
ChangeId
I3f8589b5bc8210d3866e07a9bfe8bdd513ec2688