r54728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54727‎ | r54728 | r54729 >
Date:17:10, 10 August 2009
Author:demon
Status:ok
Tags:
Comment:
Delay setting priorities since we don't have namespaces when the constructor is called
Modified paths:
  • /trunk/phase3/maintenance/generateSitemap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/generateSitemap.php
@@ -85,29 +85,7 @@
8686 *
8787 * @var array
8888 */
89 - var $priorities = array(
90 - // Custom main namespaces
91 - GS_MAIN => '0.5',
92 - // Custom talk namesspaces
93 - GS_TALK => '0.1',
94 - // MediaWiki standard namespaces
95 - NS_MAIN => '1.0',
96 - NS_TALK => '0.1',
97 - NS_USER => '0.5',
98 - NS_USER_TALK => '0.1',
99 - NS_PROJECT => '0.5',
100 - NS_PROJECT_TALK => '0.1',
101 - NS_FILE => '0.5',
102 - NS_FILE_TALK => '0.1',
103 - NS_MEDIAWIKI => '0.0',
104 - NS_MEDIAWIKI_TALK => '0.1',
105 - NS_TEMPLATE => '0.0',
106 - NS_TEMPLATE_TALK => '0.1',
107 - NS_HELP => '0.5',
108 - NS_HELP_TALK => '0.1',
109 - NS_CATEGORY => '0.5',
110 - NS_CATEGORY_TALK => '0.1',
111 - );
 89+ var $priorities = array();
11290
11391 /**
11492 * A one-dimensional array of namespaces in the wiki
@@ -164,7 +142,7 @@
165143 */
166144 public function execute() {
167145 global $wgScriptPath;
168 -
 146+ $this->setNamespacePriorities();
169147 $this->url_limit = 50000;
170148 $this->size_limit = pow( 2, 20 ) * 10;
171149 $this->fspath = self::init_path( $this->getOption( 'fspath', getcwd() ) );
@@ -176,6 +154,30 @@
177155 $this->main();
178156 }
179157
 158+ private function setNamespacePriorities() {
 159+ // Custom main namespaces
 160+ $this->priorities[GS_MAIN] = '0.5';
 161+ // Custom talk namesspaces
 162+ $this->priorities[GS_TALK] = '0.1';
 163+ // MediaWiki standard namespaces
 164+ $this->priorities[NS_MAIN] = '1.0';
 165+ $this->priorities[NS_TALK] = '0.1';
 166+ $this->priorities[NS_USER] = '0.5';
 167+ $this->priorities[NS_USER_TALK] = '0.1';
 168+ $this->priorities[NS_PROJECT] = '0.5';
 169+ $this->priorities[NS_PROJECT_TALK] = '0.1';
 170+ $this->priorities[NS_FILE] = '0.5';
 171+ $this->priorities[NS_FILE_TALK] = '0.1';
 172+ $this->priorities[NS_MEDIAWIKI] = '0.0';
 173+ $this->priorities[NS_MEDIAWIKI_TALK] = '0.1';
 174+ $this->priorities[NS_TEMPLATE] = '0.0';
 175+ $this->priorities[NS_TEMPLATE_TALK] = '0.1';
 176+ $this->priorities[NS_HELP] = '0.5';
 177+ $this->priorities[NS_HELP_TALK] = '0.1';
 178+ $this->priorities[NS_CATEGORY] = '0.5';
 179+ $this->priorities[NS_CATEGORY_TALK] = '0.1';
 180+ }
 181+
180182 /**
181183 * Create directory if it does not exist and return pathname with a trailing slash
182184 */

Status & tagging log