From: Chad Horohoe Date: Mon, 10 Aug 2009 17:10:32 +0000 (+0000) Subject: Delay setting priorities since we don't have namespaces when the constructor is called X-Git-Tag: 1.31.0-rc.0~40386 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=df6f2092499e9db64cc13d806d3ce6ec1eca6c6e;p=lhc%2Fweb%2Fwiklou.git Delay setting priorities since we don't have namespaces when the constructor is called --- diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index a2cad76a2c..67e463bccc 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -85,29 +85,7 @@ class GenerateSitemap extends Maintenance { * * @var array */ - var $priorities = array( - // Custom main namespaces - GS_MAIN => '0.5', - // Custom talk namesspaces - GS_TALK => '0.1', - // MediaWiki standard namespaces - NS_MAIN => '1.0', - NS_TALK => '0.1', - NS_USER => '0.5', - NS_USER_TALK => '0.1', - NS_PROJECT => '0.5', - NS_PROJECT_TALK => '0.1', - NS_FILE => '0.5', - NS_FILE_TALK => '0.1', - NS_MEDIAWIKI => '0.0', - NS_MEDIAWIKI_TALK => '0.1', - NS_TEMPLATE => '0.0', - NS_TEMPLATE_TALK => '0.1', - NS_HELP => '0.5', - NS_HELP_TALK => '0.1', - NS_CATEGORY => '0.5', - NS_CATEGORY_TALK => '0.1', - ); + var $priorities = array(); /** * A one-dimensional array of namespaces in the wiki @@ -164,7 +142,7 @@ class GenerateSitemap extends Maintenance { */ public function execute() { global $wgScriptPath; - + $this->setNamespacePriorities(); $this->url_limit = 50000; $this->size_limit = pow( 2, 20 ) * 10; $this->fspath = self::init_path( $this->getOption( 'fspath', getcwd() ) ); @@ -176,6 +154,30 @@ class GenerateSitemap extends Maintenance { $this->main(); } + private function setNamespacePriorities() { + // Custom main namespaces + $this->priorities[GS_MAIN] = '0.5'; + // Custom talk namesspaces + $this->priorities[GS_TALK] = '0.1'; + // MediaWiki standard namespaces + $this->priorities[NS_MAIN] = '1.0'; + $this->priorities[NS_TALK] = '0.1'; + $this->priorities[NS_USER] = '0.5'; + $this->priorities[NS_USER_TALK] = '0.1'; + $this->priorities[NS_PROJECT] = '0.5'; + $this->priorities[NS_PROJECT_TALK] = '0.1'; + $this->priorities[NS_FILE] = '0.5'; + $this->priorities[NS_FILE_TALK] = '0.1'; + $this->priorities[NS_MEDIAWIKI] = '0.0'; + $this->priorities[NS_MEDIAWIKI_TALK] = '0.1'; + $this->priorities[NS_TEMPLATE] = '0.0'; + $this->priorities[NS_TEMPLATE_TALK] = '0.1'; + $this->priorities[NS_HELP] = '0.5'; + $this->priorities[NS_HELP_TALK] = '0.1'; + $this->priorities[NS_CATEGORY] = '0.5'; + $this->priorities[NS_CATEGORY_TALK] = '0.1'; + } + /** * Create directory if it does not exist and return pathname with a trailing slash */