IXR_Client::__construct() WordPress Method

The IXR_Client::__construct() is a method of the IXR_Client class. It is used to construct an IXR_Client object. It takes two parameters: a server URL and a path. The URL is the URL of the XML-RPC server to which you want to connect. The path is the path to the XML-RPC server script on that server.

IXR_Client::__construct( $server,  $path = false,  $port = 80,  $timeout = 15 ) #

PHP5 constructor.


Source

File: wp-includes/IXR/class-IXR-client.php

    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 = isset($bits['port']) ? $bits['port'] : 80;
            $this->path = isset($bits['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;
    }

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.