r41593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41592‎ | r41593 | r41594 >
Date:09:06, 3 October 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
updated/extended documentation, some clarifications
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_UpdateJob.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php
@@ -155,8 +155,8 @@
156156 if ( $revision === NULL ) continue;
157157 $output = $wgParser->parse($revision->getText(), $title, $options, true, true, $revision->getID());
158158 SMWParseData::storeData($output, $title, false);
159 - /// FIXME: as in SMWUpdateJob, this ignores changes in header items and other parser-cached data. See the
160 - /// comment in SMWUpdateJob for details.
 159+ /// NOTE: Like SMWUpdateJob, this only updates the stored data, not the records related to page display
 160+ /// (such as the parser cache).
161161 // sleep to be nice to the server
162162 if ( ($delay !== false) && (($num_files+1) % 100 === 0) ) {
163163 usleep($delay);
Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_UpdateJob.php
@@ -1,15 +1,26 @@
22 <?php
33 /**
4 - * SMWUpdateJob updates the semantic data in the database for a given title
5 - * using the MediaWiki JobQueue.
6 - * Update jobs are created if, when saving an article, it is detected that the
7 - * content of other pages must be re-parsed as well (e.g. due to some type change).
 4+ * File containing SMWUpdateJob.
85 *
96 * @author Daniel M. Herzig
 7+ * @author Markus Krötzsch
108 * @file
119 * @ingroup SMW
1210 */
1311
 12+/**
 13+ * SMWUpdateJob updates the semantic data in the database for a given title
 14+ * using the MediaWiki JobQueue. Update jobs are created if, when saving an article,
 15+ * it is detected that the content of other pages must be re-parsed as well (e.g.
 16+ * due to some type change).
 17+ *
 18+ * @note This job does not update the page display or parser cache, so in general
 19+ * it might happen that part of the wiki page still displays based on old data (e.g.
 20+ * formatting in-page values based on a datatype thathas since been changed), whereas
 21+ * the Factbox and query/browsing interfaces might already show the updatd records.
 22+ *
 23+ * @ingroup SMW
 24+ */
1425 class SMWUpdateJob extends Job {
1526
1627 function __construct($title) {
@@ -47,12 +58,6 @@
4859 wfProfileIn( __METHOD__.'-parse' );
4960 $options = new ParserOptions;
5061 $output = $wgParser->parse($revision->getText(), $this->title, $options, true, true, $revision->getID());
51 - /// FIXME: we do not care about the parser cache here, and additional information such as the header scripts
52 - /// that the above parsing might have created is simply discarded. This yields trouble: if some datatype changes
53 - /// such that it now requires a stylesheet to display, then the parsercache will not be aware of this and hence
54 - /// the header item will be missing!
55 - /// Besides this problem, the architecture since SMW 1.4 should at least ensure that no other globals are used
56 - /// to pass around data *over long distances* and the above call thus should not disturb any other data.
5762
5863 wfProfileOut( __METHOD__.'-parse' );
5964 wfProfileIn( __METHOD__.'-update' );

Status & tagging log