Last modified: 2011-04-10 19:10:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30480, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28480 - Deprecate WebResponse::header() in favour of PHP's built-in function header()
Deprecate WebResponse::header() in favour of PHP's built-in function header()
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-10 16:44 UTC by The Evil IP address
Modified: 2011-04-10 19:10 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description The Evil IP address 2011-04-10 16:44:18 UTC
The method WebResponse::header() is a wrapper for PHP's built-in function header() that sends HTTP headers. This then often leads to code like:

$wgRequest->response()->header('HTTP/1.1 404 Not Found');

which means a lot of work with (global) objects that could be done so much easier with

header('HTTP/1.1 404 Not Found');

Not only does this save object calls and thus improves speed, it's also much easier to read if you ask me. There are no features lost, as this is really just a wrapper method.
Comment 1 Chad H. 2011-04-10 18:59:32 UTC
The wrapper is so FauxResponse can fake it for things using that.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links