r70754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70753‎ | r70754 | r70755 >
Date:07:53, 9 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed incorrectly placed wfProfileOut and minor style improvements
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_RefreshJob.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_UpdateJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_RefreshJob.php
@@ -37,10 +37,12 @@
3838 */
3939 function run() {
4040 wfProfileIn( 'SMWRefreshJob::run (SMW)' );
 41+
4142 if ( !array_key_exists( 'spos', $this->params ) ) {
 43+ wfProfileOut( 'SMWRefreshJob::run (SMW)' );
4244 return true;
43 - wfProfileOut( 'SMWRefreshJob::run (SMW)' );
4445 }
 46+
4547 $run = array_key_exists( 'run', $this->params ) ? $this->params['run']:1;
4648 $spos = $this->params['spos'];
4749 $store = smwfGetStore();
@@ -54,7 +56,9 @@
5557 $nextjob = new SMWRefreshJob( $this->title, array( 'spos' => 1, 'prog' => 0, 'rc' => $this->params['rc'], 'run' => $run + 1 ) );
5658 $nextjob->insert();
5759 }
 60+
5861 wfProfileOut( 'SMWRefreshJob::run (SMW)' );
 62+
5963 return true;
6064 }
6165
@@ -63,8 +67,9 @@
6468 * The progress refers to the state before processing this job.
6569 */
6670 public function getProgress() {
67 - $prog = array_key_exists( 'prog', $this->params ) ? $this->params['prog']:0;
68 - $run = array_key_exists( 'run', $this->params ) ? $this->params['run']:1;
 71+ $prog = array_key_exists( 'prog', $this->params ) ? $this->params['prog'] : 0;
 72+ $run = array_key_exists( 'run', $this->params ) ? $this->params['run'] : 1;
6973 return ( $run - 1 + $prog ) / $this->params['rc'];
7074 }
71 -}
 75+
 76+}
\ No newline at end of file
Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_UpdateJob.php
@@ -63,8 +63,10 @@
6464 wfProfileIn( __METHOD__ . '-update' );
6565
6666 SMWParseData::storeData( $output, $this->title, false );
 67+
6768 wfProfileOut( __METHOD__ . '-update' );
6869 wfProfileOut( 'SMWUpdateJob::run (SMW)' );
 70+
6971 return true;
7072 }
7173
@@ -80,4 +82,5 @@
8183 parent::insert();
8284 }
8385 }
84 -}
 86+
 87+}
\ No newline at end of file

Status & tagging log