"Catrope" changed the status of MediaWiki.r105641 to "fixme" and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/105641#c27626
Old Status: new
> New Status: fixme
Commit summary for MediaWiki.r105641:
an initial implementation of a stats summary system. not yet integrated into
any of the special pages
Catrope's comment:
<pre>
+ /**
+ * Wait for all the slave database servers to sync up with the master
+ */
+ public function syncDBs() {
+ // FIXME: Copied from populateAFRevisions.php, which coppied
from updateCollation.php, should be centralized somewhere
+ $lb = wfGetLB();
+ // bug 27975 - Don't try to wait for slaves if there are none
+ // Prevents permission error when getting master position
+ if ( $lb->getServerCount() > 1 ) {
+ $dbw = $lb->getConnection( DB_MASTER );
+ $pos = $dbw->getMasterPos();
+ $lb->waitForAll( $pos );
+ }
+ }
</pre>
You don't need this anymore since 1.18 was deployed. You can now simply use
<code>wfWaitForSlaves()</code> .
<pre>
+ 'converted_amount >= ' . $egFundraiserStatisticsMinimum,
+ 'converted_amount <= ' . $egFundraiserStatisticsMaximum
</pre>
I would feel safer if you ran these through intval() before injecting them into
SQL.
<pre>
+ date_default_timezone_set( 'UTC' );
</pre>
This looks like a hack. Why is this done here, rather than further up where
strtotime() is first used? Why not avoid using strtotime() altogether by
specifying the start and end dates in a time format recognized by wfTimestamp()?
<pre>+CREATE UNIQUE INDEX /*i*/prf_id ON
/*$wgDBprefix*/public_reporting_fundraisers (prf_id);</pre>
You can just make this the primary key.
<pre>
+CREATE UNIQUE INDEX /*i*/prf_id ON /*$wgDBprefix*/public_reporting_days
(prd_date);
</pre>
Misnamed index.
OK otherwise, this is looking good.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview