r86605 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86604‎ | r86605 | r86606 >
Date:09:00, 21 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
improved documentation
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_RefreshJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_RefreshJob.php
@@ -6,14 +6,14 @@
77
88 /**
99 * SMWRefreshJob iterates over all page ids of the wiki, to perform an update
10 - * action for all of them in sequence. This corresponds to the in-wiki version of
11 - * the SMW_refreshData.php script for updating the whole wiki, but it also fixes
12 - * problems with SMWSQLStore2 (which may have objects in its database that are not
13 - * proper wiki pages).
 10+ * action for all of them in sequence. This corresponds to the in-wiki version
 11+ * of the SMW_refreshData.php script for updating the whole wiki, but it also
 12+ * fixes problems with SMWSQLStore2 (which may have objects in its database
 13+ * that are not proper wiki pages).
1414 *
15 - * @note this class ignores $smwgEnableUpdateJobs and always creates updates. In
16 - * fact, it might be needed specifically on wikis that do not use update jobs in
17 - * normal operation.
 15+ * @note This class ignores $smwgEnableUpdateJobs and always creates updates.
 16+ * In fact, it might be needed specifically on wikis that do not use update
 17+ * jobs in normal operation.
1818 *
1919 * @author Markus Krötzsch
2020 * @ingroup SMW
@@ -21,11 +21,16 @@
2222 class SMWRefreshJob extends Job {
2323
2424 /**
25 - * The parameters optionally specified in the second argument of this constructor
26 - * use the following array keys: 'spos' (start index, default 1), 'prog' (progress
27 - * indicator, default 0), 'rc' (number of runs to be done, default 1). If more than
28 - * one run is done, then the first run will restrict to properties and types.
29 - * The progress indication refers to the current run, not to the overall job.
 25+ * Constructor. The parameters optionally specified in the second
 26+ * argument of this constructor use the following array keys: 'spos'
 27+ * (start index, default 1), 'prog' (progress indicator, default 0),
 28+ * ('rc' (number of runs to be done, default 1). If more than one run
 29+ * is done, then the first run will restrict to properties and types.
 30+ * The progress indication refers to the current run, not to the
 31+ * overall job.
 32+ *
 33+ * @param $title Title not relevant but needed for MW jobs
 34+ * @param $params array (associative) as explained above
3035 */
3136 function __construct( $title, $params = array( 'spos' => 1, 'prog' => 0, 'rc' => 1 ) ) {
3237 parent::__construct( 'SMWRefreshJob', $title, $params );
@@ -33,16 +38,17 @@
3439
3540 /**
3641 * Run job
 42+ *
3743 * @return boolean success
3844 */
3945 function run() {
4046 wfProfileIn( 'SMWRefreshJob::run (SMW)' );
41 -
 47+
4248 if ( !array_key_exists( 'spos', $this->params ) ) {
4349 wfProfileOut( 'SMWRefreshJob::run (SMW)' );
4450 return true;
4551 }
46 -
 52+
4753 $run = array_key_exists( 'run', $this->params ) ? $this->params['run']:1;
4854 $spos = $this->params['spos'];
4955 $namespaces = ( ( $this->params['rc'] > 1 ) && ( $run == 1 ) ) ? array( SMW_NS_PROPERTY, SMW_NS_TYPE ):false;
@@ -55,15 +61,18 @@
5662 $nextjob = new SMWRefreshJob( $this->title, array( 'spos' => 1, 'prog' => 0, 'rc' => $this->params['rc'], 'run' => $run + 1 ) );
5763 $nextjob->insert();
5864 }
59 -
 65+
6066 wfProfileOut( 'SMWRefreshJob::run (SMW)' );
61 -
 67+
6268 return true;
6369 }
6470
6571 /**
66 - * Report the estimated progress status of this job as a number between 0 and 1 (0% to 100%).
67 - * The progress refers to the state before processing this job.
 72+ * Report the estimated progress status of this job as a number between
 73+ * 0 and 1 (0% to 100%). The progress refers to the state before
 74+ * processing this job.
 75+ *
 76+ * @return double
6877 */
6978 public function getProgress() {
7079 $prog = array_key_exists( 'prog', $this->params ) ? $this->params['prog'] : 0;

Status & tagging log