jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Set _SERVER['REMOTE_ADDR'] in cli mode"
......................................................................
Revert "Set _SERVER['REMOTE_ADDR'] in cli mode"
This reverts commit 7058f989c5d57d44701d3f4d4487e792a7a9680e.
This is incorrect and breaks at least one unit test. IP addresses
shouldn't be needed in command line mode. If something is failing
because of an IP then that code path should have its assumptions
checked.
I'm not even sure that the original code for GetIP is needed--
what's the bug we're trying to avoid here? Why don't we have similar
problems in production?
Change-Id: I288974f6cb8899862eccd6dba5a37adba101855e
---
M LocalSettings.php
1 file changed, 7 insertions(+), 4 deletions(-)
Approvals:
MaxSem: Looks good to me, approved
jenkins-bot: Verified
diff --git a/LocalSettings.php b/LocalSettings.php
index ee07106..8a6c972 100644
--- a/LocalSettings.php
+++ b/LocalSettings.php
@@ -97,10 +97,13 @@
require_once __DIR__ . '/settings.d/wikis/CommonSettings.php';
-if ( PHP_SAPI === 'cli' ) {
- // Bug: 66588
- $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
-}
+// XXX: Is this a bug in core? (ori-l, 27-Aug-2013)
+$wgHooks['GetIP'][] = function ( &$ip ) {
+ if ( PHP_SAPI === 'cli' ) {
+ $ip = '127.0.0.1';
+ }
+ return true;
+};
// Execute all jobs via standalone jobrunner service rather than
// piggybacking them on web requests.
--
To view, visit https://gerrit.wikimedia.org/r/158557
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I288974f6cb8899862eccd6dba5a37adba101855e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits