r33498 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33497‎ | r33498 | r33499 >
Date:18:02, 17 April 2008
Author:minuteelectron
Status:old
Tags:
Comment:
Slightly modified version of attachment 4606 by Sergey Chernyshev, fixes bug 12860 and adds a new configuration variable $wgSitemapNamespaces to
allow specification of which namespaces a sitemap will be generated for. Defaults to false, indicating all namespaces should have a sitemap generated
for them.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/maintenance/generateSitemap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/generateSitemap.php
@@ -164,6 +164,13 @@
165165 function generateNamespaces() {
166166 $fname = 'GenerateSitemap::generateNamespaces';
167167
 168+ // Only generate for specific namespaces if $wgSitemapNamespaces is an array.
 169+ global $wgSitemapNamespaces;
 170+ if( is_array( $wgSitemapNamespaces ) ) {
 171+ $this->namespaces = $wgSitemapNamespaces;
 172+ return;
 173+ }
 174+
168175 $res = $this->dbr->select( 'page',
169176 array( 'page_namespace' ),
170177 array(),
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3038,3 +3038,10 @@
30393039 * such as PAGESINCATEGORY.
30403040 */
30413041 $wgExpensiveParserFunctionLimit = 100;
 3042+
 3043+/**
 3044+ * Array of namespaces to generate a sitemap for when the
 3045+ * maintenance/generateSitemap.php script is run, or false
 3046+ * if one is to be generated for all namespaces.
 3047+ */
 3048+$wgSitemapNamespaces = false;
\ No newline at end of file

Status & tagging log