Make WordPress Core

Ticket #12882: 12882.patch

File 12882.patch, 4.1 KB (added by jacobsantos, 15 years ago)

Initial inline documentation

  • class-http.php

     
    22/**
    33 * Simple and uniform HTTP request API.
    44 *
    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.
    67 *
    78 * @link http://trac.wordpress.org/ticket/4779 HTTP API Proposal
    89 *
     
    1415/**
    1516 * WordPress HTTP Class for managing HTTP Transports and making HTTP requests.
    1617 *
    17  * This class is called for the functionality of making HTTP requests and should replace Snoopy
    18  * functionality, eventually. There is no available functionality to add HTTP transport
    19  * implementations, since most 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.
    2021 *
    21  * The exception is that cURL is not available as a transport and lacking an implementation. It will
    22  * be added later and should be a patch on the WordPress Trac.
    23  *
    2422 * There are no properties, because none are needed and for performance reasons. Some of the
    2523 * functions are static and while they do have some overhead over functions in PHP4, the purpose is
    2624 * maintainability. When PHP5 is finally the requirement, it will be easy to add the static keyword
     
    5250        /**
    5351         * PHP5 style Constructor - Set up available transport if not available.
    5452         *
    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.
    5757         *
    58          * The transport are set up to save time. This should only be called once, so
    59          * the overhead should be fine.
    60          *
    6158         * @since 2.7.0
    6259         * @return WP_Http
    6360         */
     
    6966        /**
    7067         * Tests the WordPress HTTP objects for an object to use and returns it.
    7168         *
    72          * Tests all of the objects and returns the object that passes. Also caches
    73          * that object to be used later.
     69         * Tests all of the objects and returns the object that passes. Also caches that object to be
     70         * used later.
    7471         *
    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.
    8076         *
    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."
    8681         *
    8782         * @since 2.7.0
    8883         * @access private