r88013 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88012‎ | r88013 | r88014 >
Date:17:47, 13 May 2011
Author:demon
Status:ok
Tags:
Comment:
Kill defines in favor of class constants, not used anywhere else
Modified paths:
  • /trunk/phase3/maintenance/generateSitemap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/generateSitemap.php
@@ -1,6 +1,4 @@
22 <?php
3 -define( 'GS_MAIN', -2 );
4 -define( 'GS_TALK', -1 );
53 /**
64 * Creates a sitemap for the site
75 *
@@ -31,6 +29,9 @@
3230 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
3331
3432 class GenerateSitemap extends Maintenance {
 33+ const GS_MAIN = -2;
 34+ const GS_TALK = -1;
 35+
3536 /**
3637 * The maximum amount of urls in a sitemap file
3738 *
@@ -153,9 +154,9 @@
154155
155156 private function setNamespacePriorities() {
156157 // Custom main namespaces
157 - $this->priorities[GS_MAIN] = '0.5';
 158+ $this->priorities[self::GS_MAIN] = '0.5';
158159 // Custom talk namesspaces
159 - $this->priorities[GS_TALK] = '0.1';
 160+ $this->priorities[self::GS_TALK] = '0.1';
160161 // MediaWiki standard namespaces
161162 $this->priorities[NS_MAIN] = '1.0';
162163 $this->priorities[NS_TALK] = '0.1';
@@ -234,7 +235,7 @@
235236 * @return String
236237 */
237238 function guessPriority( $namespace ) {
238 - return MWNamespace::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK];
 239+ return MWNamespace::isMain( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK];
239240 }
240241
241242 /**

Status & tagging log