+
+ /**
+ * Gets the relevant proxy from $wgHTTPProxy/http_proxy (when set).
+ *
+ * @return mixed The proxy address or an empty string if not set.
+ */
+ public static function getProxy() {
+ global $wgHTTPProxy;
+
+ if ( $wgHTTPProxy ) {
+ return $wgHTTPProxy;
+ }
+
+ $envHttpProxy = getenv( "http_proxy" );
+ if ( $envHttpProxy ) {
+ return $envHttpProxy;
+ }
+
+ return "";
+ }