wppaste
WordPress

IXR_Client

Since
1.5.0
Source
wp-includes/IXR/class-IXR-client.php:10
IXR_Client

Compatibility

WordPress
since 1.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 10

$serverpublic
$portpublic
$pathpublic
$useragentpublic
$responsepublic
$messagepublic
$debugpublic
$timeoutpublic
$headerspublic
$errorpublic

Methods · 7

Source code

class IXR_Client{    var $server;    var $port;    var $path;    var $useragent;    var $response;    var $message = false;    var $debug = false;    var $timeout;    var $headers = array();     // Storage place for an error message    var $error = false; 	/**	 * PHP5 constructor.	 */    function __construct( $server, $path = false, $port = 80, $timeout = 15 )    {        if (!$path) {            // Assume we have been given a URL instead            $bits = parse_url($server);            $this->server = $bits['host'] ?? '';            $this->port = $bits['port'] ?? 80;            $this->path = $bits['path'] ?? '/';             // Make absolutely sure we have a path            if (!$this->path) {                $this->path = '/';            }             if ( ! empty( $bits['query'] ) ) {                $this->path .= '?' . $bits['query'];            }        } else {            $this->server = $server;            $this->path = $path;            $this->port = $port;        }        $this->useragent = 'The Incutio XML-RPC PHP Library';        $this->timeout = $timeout;    } 	/**	 * PHP4 constructor.	 */	public function IXR_Client( $server, $path = false, $port = 80, $timeout = 15 ) {		self::__construct( $server, $path, $port, $timeout );	} 	/**	 * @since 1.5.0	 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it	 *              to the function signature.	 *	 * @return bool	 */    function query( ...$args )    {        $method = array_shift($args);        $request = new IXR_Request($method, $args);        $length = $request->getLength();        $xml = $request->getXml();        $r = "\r\n";        $request  = "POST {$this->path} HTTP/1.0$r";         // Merged from WP #8145 - allow custom headers        $this->headers['Host']          = $this->server;        $this->headers['Content-Type']  = 'text/xml';        $this->headers['User-Agent']    = $this->useragent;        $this->headers['Content-Length']= $length;         foreach( $this->headers as $header => $value ) {            $request .= "{$header}: {$value}{$r}";        }        $request .= $r;         $request .= $xml;

Changelog

Introduced in 1.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/IXR/class-IXR-client.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.