Commit graph

12 commits

Author SHA1 Message Date
Kunal Mehta
230958d97c Autofix MediaWiki.Commenting.FunctionComment.SpacingDoc* errors
Change-Id: I63761ebce04c03b9b13237919c27cc10180f198f
2018-05-19 14:07:03 -07:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
Tim Starling
cde44feba3 Improve HTTP logging
* Log HTTP debug lines to the "http" channel instead of wfDebug()
* Add the ability to do debug logging to MultiHttpClient
* Add a static method Http::createMultiClient() which provides a
  MultiHttpClient configured similarly to the way individual requests
  are configured, respecting the wiki's $wgHTTPTimeout and writing debug
  logs.
* In EtcdConfig, pass the logger instance through to the MultiHttpClient
  backend.

Change-Id: Ic5bdcb0cae95d7b3715ab5261758be082751c3ff
2017-05-19 06:49:26 +02:00
Gergő Tisza
813a2dda94 MWHttpRequest: optionally add original request data
Bug: T161029
Change-Id: I16a2eec46ae9e0e242fe740be20e39a2422dc867
2017-03-27 19:20:52 +00:00
Bartosz Dziewoński
ecdef925bb Miscellaneous indentation tweaks
I was bored. What? Don't look at me that way.

I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.

Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
2017-02-27 19:23:54 +01:00
Erik Bernhardson
d67197fa11 Cleanup some incorrect return annotations
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
2016-12-12 10:15:05 -08:00
jenkins-bot
a3b1ef7c21 Merge "http: Support HTTP Basic Authentication" 2016-12-01 20:09:02 +00:00
Chrisludt
7a406355f8 http: Support HTTP Basic Authentication
Adds two new options (username and password) to the
MWHttpRequest (and HTTP helper class) to enable
support for HTTP Basic Authentication on outgoing HTTP
connections.

Change-Id: If83f025bbe63769ba7bb4a824c5f12d5f1ec640a
2016-12-01 11:54:07 -08:00
Gergő Tisza
1531659d25 Clean up http classes a bit
* added integration tests. We probably don't want automated tests
  to make external requests but these make manual testing more
  convenient. Documented some oddities discovered by testing.
* made ::$status, ::proxySetup() and ::getHeaderList()
  protected; they were not referenced in any gerrit-hosted extension
  and they provide no useful functionality to external callers.
  Similarly, marked ::read() and ::errorHandler() as internal
  (these are used as callbacks so can't be protected)
* removed inheritance abuse in ::execute()
* documented ::execute() as returning a StatusValue (but
  keep returning a Status for now)
* changed setCookie argument defaults to ones that make sense
* replaced MWException
* moved unit tests to the correct location
* fixed some code style issues

Change-Id: I5852fc75badc5d475ae30ec2c9376bde7024bd95
2016-11-30 19:00:44 -08:00
Kunal Mehta
392380ff36 http: Use Psr\Log instead of wfDebug*
MWHttpRequest::factory() will pass in a logger to move the dependency up
to the factory instead of individual functions.

Change-Id: I4e428f060c90ef49cb3acb3e3dceab64bd952330
2016-10-01 23:02:01 -07:00
Kunal Mehta
9beb668d02 Split HttpFunctions.php into separate files
Change-Id: I30d5f77de08e42ec43baf5722f40d9205c4bde67
2016-10-01 22:46:07 -07:00