r75650 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75649‎ | r75650 | r75651 >
Date:16:28, 29 October 2010
Author:demon
Status:ok
Tags:
Comment:
(bug 19593) $wgServer can't be set properly with --server attribute in command line tools. Also fixes regression in generateSitemap.php from maintenance rewrite. Also possible workaround for bug 18274.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/generateSitemap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -188,6 +188,7 @@
189189 * (bug 23194) Special:ListFiles now has thumbnails
190190 * Use hreflang to specify canonical and alternate links, search engine friendly
191191 when a wiki has multiple variant languages.
 192+* (bug 19593) Specifying --server in now works for all maintenance scripts
192193
193194 === Bug fixes in 1.17 ===
194195 * (bug 17560) Half-broken deletion moved image files to deletion archive
Index: trunk/phase3/maintenance/Maintenance.php
@@ -351,6 +351,9 @@
352352 $this->addOption( 'wiki', 'For specifying the wiki ID', false, true );
353353 $this->addOption( 'globals', 'Output globals at the end of processing for debugging' );
354354 $this->addOption( 'memory-limit', 'Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it' );
 355+ $this->addOption( 'server', "The protocol and server name to use in URLs, e.g.\n" .
 356+ "\t\thttp://en.wikipedia.org. This is sometimes necessary because\n" .
 357+ "\t\tserver name detection may fail in command line scripts.", false, true );
355358 // If we support a DB, show the options
356359 if ( $this->getDbType() > 0 ) {
357360 $this->addOption( 'dbuser', 'The DB user to use for this script', false, true );
@@ -693,7 +696,7 @@
694697 * Handle some last-minute setup here.
695698 */
696699 public function finalSetup() {
697 - global $wgCommandLineMode, $wgShowSQLErrors;
 700+ global $wgCommandLineMode, $wgShowSQLErrors, $wgServer;
698701 global $wgProfiling, $wgDBadminuser, $wgDBadminpassword;
699702 global $wgDBuser, $wgDBpassword, $wgDBservers, $wgLBFactoryConf;
700703
@@ -704,6 +707,11 @@
705708 # Same with these
706709 $wgCommandLineMode = true;
707710
 711+ # Override $wgServer
 712+ if( $this->hasOption( 'server') ) {
 713+ $wgServer = $this->getOption( 'server', $wgServer );
 714+ }
 715+
708716 # If these were passed, use them
709717 if ( $this->mDbUser ) {
710718 $wgDBadminuser = $this->mDbUser;
Index: trunk/phase3/maintenance/generateSitemap.php
@@ -128,9 +128,6 @@
129129 $this->mDescription = "Creates a sitemap for the site";
130130 $this->addOption( 'fspath', 'The file system path to save to, e.g. /tmp/sitemap' .
131131 "\n\t\tdefaults to current directory", false, true );
132 - $this->addOption( 'server', "The protocol and server name to use in URLs, e.g.\n" .
133 - "\t\thttp://en.wikipedia.org. This is sometimes necessary because\n" .
134 - "\t\tserver name detection may fail in command line scripts.", false, true );
135132 $this->addOption( 'compress', 'Compress the sitemap files, can take value yes|no, default yes', false, true );
136133 }
137134

Follow-up revisions

RevisionCommit summaryAuthorDate
r75651MFT r75650demon16:41, 29 October 2010

Status & tagging log