Chad Horohoe
7b8b26aa64
Fix odd edge case for POST Http::request()'s. I incidentally found this while working with Special:Import. For some reason that I can't 100% nail down--works fine on Win32, fails on CentOS--cURL seems to want CURLOPT_POSTFIELDS set to at least an empty string, if not values. Using a workaround I found, we'll set it to an empty string if we're making a POST. Since we explicitly allow setting of arbitrary curlopts later, users can still override the empty string if they in fact want to set this. This fixes my Special:Import problem (and possibly similar issues) and has no regressions afaict. Credit to Phill Sparks @ http://www.milk-hub.net/blog/2008/08/26/curl_error_26#comments-77
2009-01-08 06:56:11 +00:00
Chad Horohoe
380657edfc
* Move user-agent construction to its own method, so we're not writing the same string in two places (and provides a reliable way for getting MW's standard user-agent)
...
* Mark visibility, they're all public anyway
2008-11-18 22:48:03 +00:00
Tim Starling
057eb1971f
Revert r41445: static members invite permanent use in the caller, which would give us an ugly interface to remain backwards compatible with. See CodeReview.
2008-10-11 05:20:18 +00:00
Chad Horohoe
8b789e4848
Add some more debugging goodies to this. $lastCurlErrno and $lastHttpResponse are static members saved with the last returned status codes.
2008-09-30 19:58:56 +00:00
Brion Vibber
9fdb79cfd2
Curl sanity -- dump non-200 return codes and error numbers to debug log at least, rather than just silently failing.
2008-09-30 19:25:04 +00:00
Chad Horohoe
1bc6db839f
* Remove unneeded ini_set() from a very long time ago. Can't run this on allow_url_fopen nowadays.
...
* Remove extra global declaration.
2008-09-29 06:24:32 +00:00
Chad Horohoe
de193b7869
Cleanup some docs :)
2008-09-29 06:12:47 +00:00
Chad Horohoe
af7cdb8b48
Make file_get_contents() respect our timeout settings. Otherwise, we'll get 3 minute waits for timeouts potentially, which is icky.
2008-09-22 15:44:13 +00:00
Chad Horohoe
574c459824
Fix more doxygen stuff.
2008-09-20 03:44:09 +00:00
Chad Horohoe
dc404545e0
Fix some doxygen stuff.
2008-09-19 00:21:03 +00:00
Chad Horohoe
fa6d8c3dba
Add $options param to Http::get() and friends. Now things don't need to use curl directly just because they want to set specific options not set by default (I'm eying you, UploadFromUrl and SpecialUpload).
2008-09-11 00:29:51 +00:00
Chad Horohoe
3064f477ff
Add @ingroup definitions to these. Created new group HTTP for web-related things (cookies, headers, HTTP requests, etc).
2008-09-03 17:30:20 +00:00
Brion Vibber
aca1bd92fa
Revert r34877 -- duplicates wfExpandUrl()
2008-05-15 19:42:55 +00:00
Bryan Tong Minh
0ea9e36c3c
Force output of a full URL in Special:Filepath and ApiQueryImageInfo in case the wiki images are not configured to full urls.
2008-05-15 18:33:12 +00:00
Siebrand Mazeland
79d5225c0e
* remove end of line whitespace
...
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Alexandre Emsenhuber
7ac76358c3
replacing some calls from deprecated global functions to new modularized functions
2008-03-05 11:58:44 +00:00
Tim Starling
697c6b32b4
Don't return truncated output
2007-08-31 14:53:17 +00:00
Brion Vibber
e3dfb56b52
A little more cleanup on the fallback (non-cURL) HttpFunctions fetch.
...
Include a User-Agent header equivalent to the cURL one; this also is needed
when fetching export pages from Wikipedia, as we currently block the default
PHP user-agent string...
2007-07-17 15:13:57 +00:00
Brion Vibber
06e677c9c8
* (bug 10615) Fix for transwiki import when CURL not available
...
Was doing a POST without sending Content-Length header, which some web servers get real pissy about.
Now sends a 'Content-Length: 0' header
2007-07-17 14:46:43 +00:00
Aryeh Gregor
a15c419b3d
Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.)
2007-06-29 01:19:14 +00:00
River Tarnell
ec38363086
PHP Fatal error: Call to undefined function request() in /usr/local/apache/common-local/php-1.5/includes/HttpFunctions.php on line 8
...
need to qualify function with class name
2007-05-10 19:29:21 +00:00
River Tarnell
e59f873bef
- Http::request(), Http::post()
...
- don't redirect page views on POST
- Special:Export shouldn't do POST special case when page name provided
- Special:Import should use POST for interwiki fetches
2007-05-10 19:13:02 +00:00
Tim Starling
2ff288720c
Various performance and initialisation issues:
...
* Made autoloader work for unserialize()
* Made XmlFunctions.php and HttpFunctions.php autoloadable modules, via Http:: and Xml::
* Made Image class autoloadable, global functions moved to ImageFunctions.php where they can be loaded on every invocation.
* Removed some unnecessary require_once() calls
* Deferred $wgValidSkinNames initialisation
* Fixed a couple of silly construct/initialise splits. My idea from C++ experience, bad practice in PHP.
* Deferred skin initialisation in ParserOptions
* Removed $wgMwRedir during an attempt to make MagicWord autoloadable. Didn't complete that, but removing the global is still the right direction.
2006-07-02 15:57:59 +00:00
Brion Vibber
0a26267688
Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :)
2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104
Use AutoLoader to load classes:
...
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00
Lupin
c7408b9223
trailing whitespace removal
2006-03-11 17:13:49 +00:00
Lupin
11337038b3
removing unused globals and some whitespace cleaning
2006-03-07 01:10:39 +00:00
Tim Starling
61bc10203f
Various improvements to interwiki transclusion. Introduced {{raw:..}}, to force raw transclusion when subst: isn't in use. Referer header set in wfGetHTTP(), this could be for weak (honour-bound) detection of the external site, for statistics or license notices.
2006-02-01 04:41:53 +00:00
Tim Starling
8da9fca6c0
Fixes and improvements to interwiki transclusion:
...
* allow interwiki {{subst:...}} using action=raw fetches
* Allowed non-MSIE browsers to access action=raw via the article alias. This is necessary to allow action=raw transclusion, since the only known URL is the article path, not the script path.
* Specify a user agent in wfGetHttp() fetches, when using curl.
* Added transcache table to tables.sql, it was in the updater but not there for some reason.
* Fixed transcache expiry, added option
* Allow interwiki transclusion outside the template namespace using leading colon syntax. Syntax is counterintuitive at times, e.g. to subst the wikipedia main page you would use {{subst::Wikipedia:Main_Page}} not {{subst:Wikipedia::Main_Page}}.
2006-01-31 03:44:08 +00:00
Ævar Arnfjörð Bjarmason
7bbe971aec
* s~ +$~~
2006-01-07 13:09:30 +00:00
Antoine Musso
b7db9837bf
some useless calls / unitialized $matches arrays
2005-12-04 21:15:04 +00:00
Antoine Musso
2ca68a256d
Clean up unused globals!
2005-12-04 18:27:59 +00:00
Tim Starling
758d91f128
Check for error response codes, don't proxy via localhost in command line mode
2005-11-01 22:26:11 +00:00
Antoine Musso
157861bc31
fix some issues with phpdoc
2005-07-05 21:22:25 +00:00
River Tarnell
2d61f91edf
- proxy support for wfGetHTTP()
...
- support for interwiki transcludes (disabled by default, keyed on iw_trans)
2005-07-03 07:15:53 +00:00
Brion Vibber
39f7b246de
live hack
2005-06-26 18:49:40 +00:00
Tim Starling
bf452fdc63
Made a SiteConfiguration object generally available. Added functions for performing an HTTP client request using curl. This will be used in the SpamBlacklist extension, and hopefully Lucene as well.
2005-06-26 06:34:13 +00:00