Make WordPress Core

Changeset 28506


Ignore:
Timestamp:
05/19/2014 05:33:08 AM (12 years ago)
Author:
wonderboymusic
Message:

Add access modifier to methods of HTTP classes. There are no new private or protected methods, so no need for __call().

See #27881, #22234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r28317 r28506  
    6565         * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    6666         */
    67         function request( $url, $args = array() ) {
     67        public function request( $url, $args = array() ) {
    6868                global $wp_version;
    6969
     
    373373         * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    374374         */
    375         function post($url, $args = array()) {
     375        public function post($url, $args = array()) {
    376376                $defaults = array('method' => 'POST');
    377377                $r = wp_parse_args( $args, $defaults );
     
    391391         * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    392392         */
    393         function get($url, $args = array()) {
     393        public function get($url, $args = array()) {
    394394                $defaults = array('method' => 'GET');
    395395                $r = wp_parse_args( $args, $defaults );
     
    409409         * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
    410410         */
    411         function head($url, $args = array()) {
     411        public function head($url, $args = array()) {
    412412                $defaults = array('method' => 'HEAD');
    413413                $r = wp_parse_args( $args, $defaults );
     
    592592         * @return bool True to block, false to allow.
    593593         */
    594         function block_request($uri) {
     594        public function block_request($uri) {
    595595                // We don't need to block requests, because nothing is blocked.
    596596                if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL )
     
    639639        }
    640640
    641         static function make_absolute_url( $maybe_relative_path, $url ) {
     641        public static function make_absolute_url( $maybe_relative_path, $url ) {
    642642                if ( empty( $url ) )
    643643                        return $maybe_relative_path;
     
    698698         * @return false|object False if no redirect is present, a WP_HTTP or WP_Error result otherwise.
    699699         */
    700         static function handle_redirects( $url, $args, $response ) {
     700        public static function handle_redirects( $url, $args, $response ) {
    701701                // If no redirects are present, or, redirects were not requested, perform no action.
    702702                if ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] )
     
    752752         * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
    753753         */
    754         static function is_ip_address( $maybe_ip ) {
     754        public static function is_ip_address( $maybe_ip ) {
    755755                if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) )
    756756                        return 4;
     
    784784         * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
    785785         */
    786         function request($url, $args = array()) {
     786        public function request($url, $args = array()) {
    787787                $defaults = array(
    788788                        'method' => 'GET', 'timeout' => 5,
     
    10681068         * @return bool If the cerficiate presented in $stream is valid for $host
    10691069         */
    1070         static function verify_ssl_certificate( $stream, $host ) {
     1070        public static function verify_ssl_certificate( $stream, $host ) {
    10711071                $context_options = stream_context_get_options( $stream );
    10721072
     
    12191219         * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
    12201220         */
    1221         function request($url, $args = array()) {
     1221        public function request($url, $args = array()) {
    12221222                $defaults = array(
    12231223                        'method' => 'GET', 'timeout' => 5,
     
    15441544         * @return bool
    15451545         */
    1546         function is_enabled() {
     1546        public function is_enabled() {
    15471547                return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT');
    15481548        }
     
    15581558         * @return bool
    15591559         */
    1560         function use_authentication() {
     1560        public function use_authentication() {
    15611561                return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD');
    15621562        }
     
    15691569         * @return string
    15701570         */
    1571         function host() {
     1571        public function host() {
    15721572                if ( defined('WP_PROXY_HOST') )
    15731573                        return WP_PROXY_HOST;
     
    15831583         * @return string
    15841584         */
    1585         function port() {
     1585        public function port() {
    15861586                if ( defined('WP_PROXY_PORT') )
    15871587                        return WP_PROXY_PORT;
     
    15971597         * @return string
    15981598         */
    1599         function username() {
     1599        public function username() {
    16001600                if ( defined('WP_PROXY_USERNAME') )
    16011601                        return WP_PROXY_USERNAME;
     
    16111611         * @return string
    16121612         */
    1613         function password() {
     1613        public function password() {
    16141614                if ( defined('WP_PROXY_PASSWORD') )
    16151615                        return WP_PROXY_PASSWORD;
     
    16251625         * @return string
    16261626         */
    1627         function authentication() {
     1627        public function authentication() {
    16281628                return $this->username() . ':' . $this->password();
    16291629        }
     
    16361636         * @return string
    16371637         */
    1638         function authentication_header() {
     1638        public function authentication_header() {
    16391639                return 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() );
    16401640        }
     
    16531653         * @return bool True, to send through the proxy and false if, the proxy should not be used.
    16541654         */
    1655         function send_through_proxy( $uri ) {
     1655        public function send_through_proxy( $uri ) {
    16561656                // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
    16571657                // This will be displayed on blogs, which is not reasonable.
     
    17271727         * @var string
    17281728         */
    1729         var $name;
     1729        public $name;
    17301730
    17311731        /**
     
    17351735         * @var string
    17361736         */
    1737         var $value;
     1737        public $value;
    17381738
    17391739        /**
     
    17431743         * @var string
    17441744         */
    1745         var $expires;
     1745        public $expires;
    17461746
    17471747        /**
     
    17511751         * @var string
    17521752         */
    1753         var $path;
     1753        public $path;
    17541754
    17551755        /**
     
    17591759         * @var string
    17601760         */
    1761         var $domain;
     1761        public $domain;
    17621762
    17631763        /**
     
    17831783         * @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values
    17841784         */
    1785         function __construct( $data, $requested_url = '' ) {
     1785        public function __construct( $data, $requested_url = '' ) {
    17861786                if ( $requested_url )
    17871787                        $arrURL = @parse_url( $requested_url );
     
    18431843         * @return boolean true if allowed, false otherwise.
    18441844         */
    1845         function test( $url ) {
     1845        public function test( $url ) {
    18461846                if ( is_null( $this->name ) )
    18471847                        return false;
     
    18871887         * @return string Header encoded cookie name and value.
    18881888         */
    1889         function getHeaderValue() {
     1889        public function getHeaderValue() {
    18901890                if ( ! isset( $this->name ) || ! isset( $this->value ) )
    18911891                        return '';
     
    19101910         * @return string
    19111911         */
    1912         function getFullHeader() {
     1912        public function getFullHeader() {
    19131913                return 'Cookie: ' . $this->getHeaderValue();
    19141914        }
Note: See TracChangeset for help on using the changeset viewer.