r111431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111430‎ | r111431 | r111432 >
Date:22:47, 13 February 2012
Author:werdna
Status:ok
Tags:
Comment:
Move bucket config to LocalSettings.php instead of hard coding
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationUtil.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationUtil.php
@@ -12,22 +12,15 @@
1313 * @return bool whether or not it is.
1414 */
1515 public static function isEnabled() {
16 - global $wgUser, $wgArticleCreationRegistrationCutoff;
 16+ global $wgUser, $wgArticleCreationRegistrationCutoff,
 17+ $wgArticleCreationBucketConfig;
1718
1819 $userRegistration = wfTimestamp( TS_MW, $wgUser->getRegistration() );
1920
20 - $bucketConfig = array(
21 - 'buckets' => array(
22 - 'on' => 99,
23 - 'off' => 1,
24 - ),
25 - 'version' => 1,
26 - );
27 -
2821 if ( !$userRegistration ||
2922 $userRegistration > $wgArticleCreationRegistrationCutoff
3023 ) {
31 - $bucket = PHPBucket::getBucket( 'ac-enabled', $bucketConfig );
 24+ $bucket = PHPBucket::getBucket( 'ac-enabled', $wgArticleCreationBucketConfig );
3225
3326 return $bucket === 'on';
3427 } else {
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php
@@ -176,4 +176,12 @@
177177 'buttons' => $wgArticleCreationButtons,
178178 );
179179
 180+$wgArticleCreationBucketConfig = array(
 181+ 'buckets' => array(
 182+ 'on' => 1,
 183+ 'off' => 99,
 184+ ),
 185+ 'version' => 1,
 186+);
 187+
180188 $wgArticleCreationRegistrationCutoff = '20110205121212';

Status & tagging log