Last modified: 2008-10-06 07:31:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14586, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12586 - Change $wguname/$wgNodeName/wfHostname behaviour
Change $wguname/$wgNodeName/wfHostname behaviour
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Tim Starling
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-11 19:11 UTC by Alexandre Emsenhuber [IAlex]
Modified: 2008-10-06 07:31 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
proposed patch (3.84 KB, patch)
2008-01-11 19:11 UTC, Alexandre Emsenhuber [IAlex]
Details
new patch (3.97 KB, patch)
2008-01-13 18:08 UTC, Alexandre Emsenhuber [IAlex]
Details

Description Alexandre Emsenhuber [IAlex] 2008-01-11 19:11:10 UTC
Created attachment 4532 [details]
proposed patch

Actually $wguname['nodename'] is used by Database.php and Profiler.php or $wguname isn't set on windows and other platforms where posix_uname() doesn't exist. I modified these files to use $wgNodeName wich contains the same value, i also modified Setup.php to use php_uname('n') wich return the computer's name on Windows (it is the case with my version of Windows XP) before $_SERVER['SERVER_NAME'] if posix_uname() is aviable. As this does now the same thing as wfHostname(), i modified this function to simply returns $wgNodeName.

Maybe all this should be done in wfHostname() but i don't konw if an extension is using $wguname/$wgNodeName.
Comment 1 Alexandre Emsenhuber [IAlex] 2008-01-13 18:08:23 UTC
Created attachment 4540 [details]
new patch

Sorry, i didn't see there was a syntax error in the other patch, now fixed.
Comment 2 Brion Vibber 2008-01-14 23:15:02 UTC
Tim, can you check this one on Windows?
Comment 3 Tim Starling 2008-01-15 02:05:22 UTC
The patch introduces $wgNodeName and uses it in several places. I'd rather use the global function wfHostname() rather than encourage the use of global variables that can't be lazy-initialised. 

$_SERVER['SERVER_NAME'] is set to the virtual host on my WAMP server. $_ENV['COMPUTERNAME'] is set to the computer name regardless of virtual host, perhaps that would be a better choice for Windows, assuming it's documented and reliable. 
Comment 4 Tim Starling 2008-01-15 02:14:30 UTC
Indirect reference here:

<http://msdn2.microsoft.com/en-us/library/system.environment.machinename.aspx>

Implies the .NET framework property for getting the computer name does so by reading the COMPUTERNAME environment variable.
Comment 5 Tim Starling 2008-10-06 07:31:01 UTC
Fixed in r41733.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links