Commit graph

94 commits

Author SHA1 Message Date
Mark A. Hershberger
116fe657e2 * Fixes Bug #22268
* Document parseHeader()
* Separate out setStatus() so it can be called from execute()
* Avoid core dumps on older PHPs when using PhpHttpRequest and doing redirects
* Add getResponseHeader() for getting the response headers
* Add special handling on tests for older PHP
2010-02-22 05:12:20 +00:00
Tim Starling
ba7a9c2959 Fix call to nonexistent function from r61357 2010-02-16 01:06:49 +00:00
Mark A. Hershberger
d74e55fc09 Fix problem of incorrect Status message use.
Uncovered an additional problem with HTTP error messages and PhpHttpRequest
2010-02-09 08:23:09 +00:00
Mark A. Hershberger
e51c98f687 fix messages for http non-200 messages 2010-02-09 06:46:20 +00:00
Mark A. Hershberger
c8c68401e7 Fix Http::request() so that it continues to return false on non-200 requests. 2010-02-09 06:18:53 +00:00
Mark A. Hershberger
a126ce6f48 Add a bunch of tests and checks for cookie domain security. 2010-02-08 05:38:09 +00:00
Mark A. Hershberger
4dc061b65f Test cases working with “make tap” but not just “phpunit” right now.
“make tap” spawns a new php instance for each test file.

Found some problems with date/time parsing on older 32bit php.  I
forgot the year 2999 isn't a valid epoch date.
2010-02-07 05:45:37 +00:00
Mark A. Hershberger
c5cbbfd580 Add domain checking to HTTP cookie checking. 2010-02-05 04:08:19 +00:00
Mark A. Hershberger
6e40cc93fa Add preliminary API tests. Next step: UploadChunks API testing. 2010-02-03 07:45:05 +00:00
Mark A. Hershberger
62177bc9d1 follow-up r61655 fill out the rest of the missing messages
Add cookie handling to HttpFunctions.
2010-02-03 06:19:47 +00:00
Mark A. Hershberger
bff36836ab follow up r61357
* fix up fopen warnings — I was bedazzled by phpUnit's
  set_error_handler that turned warnings into exceptions and Tim set
  me right.
* Use Tim's read loop
* No need for private $fh member
* Fix some minor problems with PHP versions (no "timeout" param in
  pre-5.2.1, POST issue in Hardy's PHP version where timeout is null.)
* Fix how tests are run on old versions of phpUnit.
2010-01-29 07:25:09 +00:00
Mark A. Hershberger
a512cc9152 Make the instantiation tests actually work. 2010-01-27 06:51:42 +00:00
Niklas Laxström
03fc54cd44 Log HTTP requests similar to SQL queries and other stuff 2010-01-23 22:30:21 +00:00
Mark A. Hershberger
adc73fd295 follow up r61356 -- remove global 2010-01-23 06:23:18 +00:00
Mark A. Hershberger
5d210b50f3 Follow up 61352, address TimStarling's comments. 2010-01-22 07:50:02 +00:00
Mark A. Hershberger
ec0db4debd stylize, message fixups. 2010-01-22 03:01:48 +00:00
Mark A. Hershberger
5398f6eed2 follow up r61078, fixes bug 22224
Rewrite of HttpFunctions.php
Stripping async download, simple file writer stuff.
2010-01-22 02:17:58 +00:00
Raimond Spekking
826ba4f215 Revert r61078/r61079 for now. Throws a lot of PHP warnings at translatewiki. See CR for details 2010-01-15 18:57:29 +00:00
Jure Kajzer
f05a3b22e4 Fixed fatal error by defineing a blank function in parent class 2010-01-15 10:12:00 +00:00
Mark A. Hershberger
0f1224fd92 follow-up r60811 clean up code, write some tests for the existing uses of HttpFunctions. Still need to test background download, proxy tests, etc. 2010-01-15 05:56:57 +00:00
Michael Dale
2fbb62a4c5 * fix for bug 20512 ( in both trunk and js2-work branch )
** Add 'proxy' option to Http $opts array
** Setting 'proxy' option to "false" will bypass the proxy
* Updated MWSearch_body.php to use new "false" option
2010-01-07 21:57:33 +00:00
Alexandre Emsenhuber
95e1a7210b Doxygen fixes:
* remove duplicated definition of "Wikimedia" group in cleanupTable.inc
* define "HTTP" and "Wikimedia" groups in a separate comment so that doxygen doesn't throw "Cannot assign group to itself"
2009-12-05 17:07:40 +00:00
Chad Horohoe
f9047c8ca1 Fix header 2009-11-28 03:49:29 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Chad Horohoe
14bbcfdcd4 rm unused global 2009-11-06 16:38:19 +00:00
Michael Dale
f5ec8e6ef5 * set the --wiki to wfWikiId 2009-10-20 00:25:36 +00:00
Michael Dale
1e4165061b more (bug 20336)
* added json folder 
* moved Services_JSON.php there
* moved Format JSON into its own class
* updated AutoLoader
2009-09-10 14:33:25 +00:00
Tim Starling
7b7f9f0d4d Comments and whitespace fixes only. 2009-09-10 06:43:01 +00:00
Michael Dale
3bc78b785a * r55034#c3604 re-factored presently used curl options to back-end agnostic options.
* broke out curl and php based requests into separate classes ( more general cleanup is of course possible :)
* @@todo these tokens need to be mapped to php fopen stream "context" along with a more general mapping of the rest of the curl options.
2009-09-01 16:01:51 +00:00
Bryan Tong Minh
c2033042ee * Code style & commenting on upload functions.
* Move isValidURI from UploadFromUrl to HttpFunctions.
* Made some functions in UploadBase static.
2009-08-26 17:05:24 +00:00
Chad Horohoe
4684e284e0 Followup r53884, use wfSuppressWarnings/wfRestoreWarnings instead of @ 2009-08-19 01:55:13 +00:00
Michael Dale
16bf140f66 fixed variable name 2009-08-14 18:56:45 +00:00
Michael Dale
c89ea20030 http:get was clearing opts array (fixed) 2009-08-14 18:03:15 +00:00
Michael Dale
7049cbd76e * added curl option support for get requests 2009-08-14 18:01:05 +00:00
Michael Dale
3e052756db added memchached compatibility to background downloads. 2009-08-13 20:39:20 +00:00
Brion Vibber
40038bfe4a Suppress 'Expect: 100-continue' header on Http::post, as some servers will reject it with a 417 and Curl won't auto retry.
Curl seems to like to insert this HTTP 1.1 request header sometimes, but not always, when you add post data.
2009-08-02 07:36:47 +00:00
Brion Vibber
ab7470b6e8 Allow passing postdata in Http::post() options...
Note -- CURL allows you to pass an array which it will encode as multipart, but this doesn't seem to work for me.
Until resolved, do URL form encoding yourself with wfArrayToCGI() and pass in a string.
Todo: implement also for non-CURL mode if possible?
2009-07-30 22:11:44 +00:00
Michael Dale
d772611135 checking for session_id() was preventing updates (just put a @ infront to ignore E_NOTICE for php 4.3.3 and greater ) 2009-07-28 17:38:33 +00:00
Michael Dale
ae1b5f9855 * ( bug 19932 ) simpleFileWriter::close was still issuing a update_session_progress call even if do_close_session_update was off 2009-07-28 17:29:32 +00:00
Niklas Laxström
a2f8c30442 * formatSize is not static
* isset returns bool
2009-07-28 06:54:07 +00:00
Michael Dale
996d17d401 * ignorewarnings fixes
* removed extra debug statement 
* supports do_close_session_update for php based requests
2009-07-27 21:32:25 +00:00
Michael Dale
6af2322f85 * ( bug 19930 ) default to SYNC_DOWNLOAD 2009-07-27 19:00:27 +00:00
Michael Dale
4a200aa70f * (bug 19932) added do_close_session_update to avoid closing session on synchronous requests
* some upload js cleanup / bug fixes
2009-07-27 15:24:14 +00:00
Michael Dale
80a0e63f54 applies patch from bug 19934 2009-07-27 00:42:26 +00:00
Jack Phoenix
5af8e55976 coding style tweaks 2009-07-25 20:05:41 +00:00
Alex Z
a7c9a7e4cc Fix a couple notices/strict warnings 2009-07-25 00:19:36 +00:00
Michael Dale
a3a5708d69 fixes bug 19736
If you did not have the wgServer var set manually the internal shell request for the download would result in localhost being used for the API result url.
2009-07-23 21:28:54 +00:00
Alexandre Emsenhuber
e7802f4848 remove debugging code *stab* 2009-07-21 20:32:41 +00:00
Alexandre Emsenhuber
e35b28c0e0 * don't require allow_url_fopen enabled when cURL is available
* implemented get_headers() with cURL (headers_only option in HttpRequest)
* fix some possible ENOTICE
* some spacing fixes
2009-07-21 20:31:49 +00:00
Michael Dale
a7f7dc29cc fixed php based request path (uses fopen instead of curl) r53282 c3232 2009-07-17 19:06:36 +00:00