<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[28506] trunk/src/wp-includes/class-http.php: Add access modifier to methods of HTTP classes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/28506">28506</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-05-19 05:33:08 +0000 (Mon, 19 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add access modifier to methods of HTTP classes. There are no new private or protected methods, so no need for `__call()`.

 See <a href="http://core.trac.wordpress.org/ticket/27881">#27881</a>, <a href="http://core.trac.wordpress.org/ticket/22234">#22234</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasshttpphp">trunk/src/wp-includes/class-http.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasshttpphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-http.php (28505 => 28506)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-http.php     2014-05-19 05:26:48 UTC (rev 28505)
+++ trunk/src/wp-includes/class-http.php        2014-05-19 05:33:08 UTC (rev 28506)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">   * @param str|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx">   */
</span><del>-       function request( $url, $args = array() ) {
</del><ins>+        public function request( $url, $args = array() ) {
</ins><span class="cx">           global $wp_version;
</span><span class="cx"> 
</span><span class="cx">          $defaults = array(
</span><span class="lines">@@ -372,7 +372,7 @@
</span><span class="cx">   * @param string|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx">   */
</span><del>-       function post($url, $args = array()) {
</del><ins>+        public function post($url, $args = array()) {
</ins><span class="cx">           $defaults = array('method' => 'POST');
</span><span class="cx">          $r = wp_parse_args( $args, $defaults );
</span><span class="cx">          return $this->request($url, $r);
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx">   * @param str|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx">   */
</span><del>-       function get($url, $args = array()) {
</del><ins>+        public function get($url, $args = array()) {
</ins><span class="cx">           $defaults = array('method' => 'GET');
</span><span class="cx">          $r = wp_parse_args( $args, $defaults );
</span><span class="cx">          return $this->request($url, $r);
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">   * @param str|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx">   */
</span><del>-       function head($url, $args = array()) {
</del><ins>+        public function head($url, $args = array()) {
</ins><span class="cx">           $defaults = array('method' => 'HEAD');
</span><span class="cx">          $r = wp_parse_args( $args, $defaults );
</span><span class="cx">          return $this->request($url, $r);
</span><span class="lines">@@ -591,7 +591,7 @@
</span><span class="cx">   * @param string $uri URI of url.
</span><span class="cx">   * @return bool True to block, false to allow.
</span><span class="cx">   */
</span><del>-       function block_request($uri) {
</del><ins>+        public function block_request($uri) {
</ins><span class="cx">           // We don't need to block requests, because nothing is blocked.
</span><span class="cx">          if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL )
</span><span class="cx">                  return false;
</span><span class="lines">@@ -638,7 +638,7 @@
</span><span class="cx"> 
</span><span class="cx">  }
</span><span class="cx"> 
</span><del>-       static function make_absolute_url( $maybe_relative_path, $url ) {
</del><ins>+        public static function make_absolute_url( $maybe_relative_path, $url ) {
</ins><span class="cx">           if ( empty( $url ) )
</span><span class="cx">                  return $maybe_relative_path;
</span><span class="cx"> 
</span><span class="lines">@@ -697,7 +697,7 @@
</span><span class="cx">   * @param array $response The Response of the HTTP request.
</span><span class="cx">   * @return false|object False if no redirect is present, a WP_HTTP or WP_Error result otherwise.
</span><span class="cx">   */
</span><del>-       static function handle_redirects( $url, $args, $response ) {
</del><ins>+        public static function handle_redirects( $url, $args, $response ) {
</ins><span class="cx">           // If no redirects are present, or, redirects were not requested, perform no action.
</span><span class="cx">          if ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] )
</span><span class="cx">                  return false;
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx">   * @param string $maybe_ip A suspected IP address
</span><span class="cx">   * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
</span><span class="cx">   */
</span><del>-       static function is_ip_address( $maybe_ip ) {
</del><ins>+        public static function is_ip_address( $maybe_ip ) {
</ins><span class="cx">           if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) )
</span><span class="cx">                  return 4;
</span><span class="cx"> 
</span><span class="lines">@@ -783,7 +783,7 @@
</span><span class="cx">   * @param string|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
</span><span class="cx">   */
</span><del>-       function request($url, $args = array()) {
</del><ins>+        public function request($url, $args = array()) {
</ins><span class="cx">           $defaults = array(
</span><span class="cx">                  'method' => 'GET', 'timeout' => 5,
</span><span class="cx">                  'redirection' => 5, 'httpversion' => '1.0',
</span><span class="lines">@@ -1067,7 +1067,7 @@
</span><span class="cx">   * @param string $host The hostname being requested
</span><span class="cx">   * @return bool If the cerficiate presented in $stream is valid for $host
</span><span class="cx">   */
</span><del>-       static function verify_ssl_certificate( $stream, $host ) {
</del><ins>+        public static function verify_ssl_certificate( $stream, $host ) {
</ins><span class="cx">           $context_options = stream_context_get_options( $stream );
</span><span class="cx"> 
</span><span class="cx">          if ( empty( $context_options['ssl']['peer_certificate'] ) )
</span><span class="lines">@@ -1218,7 +1218,7 @@
</span><span class="cx">   * @param str|array $args Optional. Override the defaults.
</span><span class="cx">   * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys.
</span><span class="cx">   */
</span><del>-       function request($url, $args = array()) {
</del><ins>+        public function request($url, $args = array()) {
</ins><span class="cx">           $defaults = array(
</span><span class="cx">                  'method' => 'GET', 'timeout' => 5,
</span><span class="cx">                  'redirection' => 5, 'httpversion' => '1.0',
</span><span class="lines">@@ -1543,7 +1543,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return bool
</span><span class="cx">   */
</span><del>-       function is_enabled() {
</del><ins>+        public function is_enabled() {
</ins><span class="cx">           return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT');
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -1557,7 +1557,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return bool
</span><span class="cx">   */
</span><del>-       function use_authentication() {
</del><ins>+        public function use_authentication() {
</ins><span class="cx">           return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD');
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -1568,7 +1568,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function host() {
</del><ins>+        public function host() {
</ins><span class="cx">           if ( defined('WP_PROXY_HOST') )
</span><span class="cx">                  return WP_PROXY_HOST;
</span><span class="cx"> 
</span><span class="lines">@@ -1582,7 +1582,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function port() {
</del><ins>+        public function port() {
</ins><span class="cx">           if ( defined('WP_PROXY_PORT') )
</span><span class="cx">                  return WP_PROXY_PORT;
</span><span class="cx"> 
</span><span class="lines">@@ -1596,7 +1596,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function username() {
</del><ins>+        public function username() {
</ins><span class="cx">           if ( defined('WP_PROXY_USERNAME') )
</span><span class="cx">                  return WP_PROXY_USERNAME;
</span><span class="cx"> 
</span><span class="lines">@@ -1610,7 +1610,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function password() {
</del><ins>+        public function password() {
</ins><span class="cx">           if ( defined('WP_PROXY_PASSWORD') )
</span><span class="cx">                  return WP_PROXY_PASSWORD;
</span><span class="cx"> 
</span><span class="lines">@@ -1624,7 +1624,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function authentication() {
</del><ins>+        public function authentication() {
</ins><span class="cx">           return $this->username() . ':' . $this->password();
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -1635,7 +1635,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function authentication_header() {
</del><ins>+        public function authentication_header() {
</ins><span class="cx">           return 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -1652,7 +1652,7 @@
</span><span class="cx">   * @param string $uri URI to check.
</span><span class="cx">   * @return bool True, to send through the proxy and false if, the proxy should not be used.
</span><span class="cx">   */
</span><del>-       function send_through_proxy( $uri ) {
</del><ins>+        public function send_through_proxy( $uri ) {
</ins><span class="cx">           // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
</span><span class="cx">          // This will be displayed on blogs, which is not reasonable.
</span><span class="cx">          $check = @parse_url($uri);
</span><span class="lines">@@ -1726,7 +1726,7 @@
</span><span class="cx">   * @since 2.8.0
</span><span class="cx">   * @var string
</span><span class="cx">   */
</span><del>-       var $name;
</del><ins>+        public $name;
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Cookie value.
</span><span class="lines">@@ -1734,7 +1734,7 @@
</span><span class="cx">   * @since 2.8.0
</span><span class="cx">   * @var string
</span><span class="cx">   */
</span><del>-       var $value;
</del><ins>+        public $value;
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * When the cookie expires.
</span><span class="lines">@@ -1742,7 +1742,7 @@
</span><span class="cx">   * @since 2.8.0
</span><span class="cx">   * @var string
</span><span class="cx">   */
</span><del>-       var $expires;
</del><ins>+        public $expires;
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Cookie URL path.
</span><span class="lines">@@ -1750,7 +1750,7 @@
</span><span class="cx">   * @since 2.8.0
</span><span class="cx">   * @var string
</span><span class="cx">   */
</span><del>-       var $path;
</del><ins>+        public $path;
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Cookie Domain.
</span><span class="lines">@@ -1758,7 +1758,7 @@
</span><span class="cx">   * @since 2.8.0
</span><span class="cx">   * @var string
</span><span class="cx">   */
</span><del>-       var $domain;
</del><ins>+        public $domain;
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Sets up this cookie object.
</span><span class="lines">@@ -1782,7 +1782,7 @@
</span><span class="cx">   * @param string|array $data Raw cookie data.
</span><span class="cx">   * @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values
</span><span class="cx">   */
</span><del>-       function __construct( $data, $requested_url = '' ) {
</del><ins>+        public function __construct( $data, $requested_url = '' ) {
</ins><span class="cx">           if ( $requested_url )
</span><span class="cx">                  $arrURL = @parse_url( $requested_url );
</span><span class="cx">          if ( isset( $arrURL['host'] ) )
</span><span class="lines">@@ -1842,7 +1842,7 @@
</span><span class="cx">   * @param string $url URL you intend to send this cookie to
</span><span class="cx">   * @return boolean true if allowed, false otherwise.
</span><span class="cx">   */
</span><del>-       function test( $url ) {
</del><ins>+        public function test( $url ) {
</ins><span class="cx">           if ( is_null( $this->name ) )
</span><span class="cx">                  return false;
</span><span class="cx"> 
</span><span class="lines">@@ -1886,7 +1886,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string Header encoded cookie name and value.
</span><span class="cx">   */
</span><del>-       function getHeaderValue() {
</del><ins>+        public function getHeaderValue() {
</ins><span class="cx">           if ( ! isset( $this->name ) || ! isset( $this->value ) )
</span><span class="cx">                  return '';
</span><span class="cx"> 
</span><span class="lines">@@ -1909,7 +1909,7 @@
</span><span class="cx">   *
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><del>-       function getFullHeader() {
</del><ins>+        public function getFullHeader() {
</ins><span class="cx">           return 'Cookie: ' . $this->getHeaderValue();
</span><span class="cx">  }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>