Ticket #12882: 12882.patch
File 12882.patch, 4.1 KB (added by , 15 years ago) |
---|
-
class-http.php
2 2 /** 3 3 * Simple and uniform HTTP request API. 4 4 * 5 * Will eventually replace and standardize the WordPress HTTP requests made. 5 * Standardizes the HTTP requests for WordPress. Handles cookies, gzip encoding and decoding, chunk 6 * decoding, if HTTP 1.1 and various other difficult HTTP protocol implementations. 6 7 * 7 8 * @link http://trac.wordpress.org/ticket/4779 HTTP API Proposal 8 9 * … … 14 15 /** 15 16 * WordPress HTTP Class for managing HTTP Transports and making HTTP requests. 16 17 * 17 * This class is called for the functionality of making HTTP requests and should replaceSnoopy18 * functionality , eventually. There is no available functionality to add HTTP transport19 * implementations, sincemost of the HTTP transports are added and available for use.18 * This class is called for the functionality of making HTTP requests and replaces Snoopy 19 * functionality. There is no available functionality to add HTTP transport implementations, since 20 * most of the HTTP transports are added and available for use. 20 21 * 21 * The exception is that cURL is not available as a transport and lacking an implementation. It will22 * be added later and should be a patch on the WordPress Trac.23 *24 22 * There are no properties, because none are needed and for performance reasons. Some of the 25 23 * functions are static and while they do have some overhead over functions in PHP4, the purpose is 26 24 * maintainability. When PHP5 is finally the requirement, it will be easy to add the static keyword … … 52 50 /** 53 51 * PHP5 style Constructor - Set up available transport if not available. 54 52 * 55 * PHP4 does not have the 'self' keyword and since WordPress supports PHP4, 56 * the class needs to be used for the static call. 53 * PHP4 does not have the 'self' keyword and since WordPress supports PHP4, the class needs to 54 * be used for the static call. The transport are set up to save time and will only be created 55 * once. This class can be created many times without having to go through the step of finding 56 * which transports are available. 57 57 * 58 * The transport are set up to save time. This should only be called once, so59 * the overhead should be fine.60 *61 58 * @since 2.7.0 62 59 * @return WP_Http 63 60 */ … … 69 66 /** 70 67 * Tests the WordPress HTTP objects for an object to use and returns it. 71 68 * 72 * Tests all of the objects and returns the object that passes. Also caches 73 * that object to beused later.69 * Tests all of the objects and returns the object that passes. Also caches that object to be 70 * used later. 74 71 * 75 * The order for the GET/HEAD requests are HTTP Extension, cURL, Streams, Fopen, 76 * and finally Fsockopen. fsockopen() is used last, because it has the most 77 * overhead in its implementation. There isn't any real way around it, since 78 * redirects have to be supported, much the same way the other transports 79 * also handle redirects. 72 * The order for the GET/HEAD requests are HTTP Extension, cURL, Streams, Fopen, and finally 73 * Fsockopen. fsockopen() is used last, because it has the most overhead in its implementation. 74 * There isn't any real way around it, since redirects have to be supported, much the same way 75 * the other transports also handle redirects. 80 76 * 81 * There are currently issues with "localhost" not resolving correctly with 82 * DNS. This may cause an error "failed to open stream: A connection attempt 83 * failed because the connected party did not properly respond after a 84 * period of time, or established connection failed because connected host 85 * has failed to respond." 77 * There are currently issues with "localhost" not resolving correctly with DNS. This may cause 78 * an error "failed to open stream: A connection attempt failed because the connected party did 79 * not properly respond after a period of time, or established connection failed because [the] 80 * connected host has failed to respond." 86 81 * 87 82 * @since 2.7.0 88 83 * @access private