Index: trunk/phase3/maintenance/generateSitemap.php |
— | — | @@ -85,29 +85,7 @@ |
86 | 86 | * |
87 | 87 | * @var array |
88 | 88 | */ |
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(); |
112 | 90 | |
113 | 91 | /** |
114 | 92 | * A one-dimensional array of namespaces in the wiki |
— | — | @@ -164,7 +142,7 @@ |
165 | 143 | */ |
166 | 144 | public function execute() { |
167 | 145 | global $wgScriptPath; |
168 | | - |
| 146 | + $this->setNamespacePriorities(); |
169 | 147 | $this->url_limit = 50000; |
170 | 148 | $this->size_limit = pow( 2, 20 ) * 10; |
171 | 149 | $this->fspath = self::init_path( $this->getOption( 'fspath', getcwd() ) ); |
— | — | @@ -176,6 +154,30 @@ |
177 | 155 | $this->main(); |
178 | 156 | } |
179 | 157 | |
| 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 | + |
180 | 182 | /** |
181 | 183 | * Create directory if it does not exist and return pathname with a trailing slash |
182 | 184 | */ |