[wp-trac] [WordPress Trac] #13777: Consolidate WP_Http argument processing into a single class

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 26 18:18:40 UTC 2011


#13777: Consolidate WP_Http argument processing into a single class
-------------------------+--------------------------
 Reporter:  jacobsantos  |       Owner:  jacobsantos
     Type:  enhancement  |      Status:  reopened
 Priority:  low          |   Milestone:
Component:  HTTP         |     Version:  3.0
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |
-------------------------+--------------------------

Comment (by jacobsantos):

 Replying to [comment:8 dd32]:
 > After reading your comment, The only other option I could understand is
 that you're suggesting moving all the processing to a separate class so
 that you can call WP_HTTP directly OR call a subclass directly?

 Yes. Right now, if you want to use a Transport and want to send post data,
 something the WP_HTTP does automatically to set the headers and format the
 post data, if array; you'd have to duplicate that code before you use the
 Transport. Goes for other features of WP_HTTP::request() handling as well.
 Since the WP_HTTP::request() received / receives the majority of support
 and feature additions, it is better to consolidate all of the code to a
 single place (a later patch that I never uploaded used a function instead)
 and call it for each of the transports.

 In this way, the WP_HTTP::request() only handles calling the transports
 and passing the processed information. It would shorten the
 WP_HTTP::request() to a single action (there is a term used for OOP that I
 can't remember at the moment, meaning limiting a method and, or class to a
 single task or service). Right now the WP_HTTP::request() is doing two
 things, processing the args and running through the working transports.

 This ticket is to move the processing of the args out of
 WP_HTTP::request() to allow for the Transports to use the same code
 without duplication.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13777#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list