You are here

trait XmlRpcTrait in xmlrpc 8

XmlRpcTrait provides the getEndpoint() method used in tests and examples.

Hierarchy

4 files declare their use of XmlRpcTrait
XmlRpcExampleClientForm.php in xmlrpc_example/src/Form/XmlRpcExampleClientForm.php
XmlRpcExampleController.php in xmlrpc_example/src/Controller/XmlRpcExampleController.php
XmlRpcExampleTest.php in xmlrpc_example/src/Tests/XmlRpcExampleTest.php
XmlRpcMessagesTest.php in src/Tests/XmlRpcMessagesTest.php

File

src/XmlRpcTrait.php, line 10

Namespace

Drupal\xmlrpc
View source
trait XmlRpcTrait {

  /**
   * The XML-RPC server endpoint.
   *
   * @var string
   */
  protected $endPoint;

  /**
   * Returns the URI of the server XML-RPC endpoint.
   *
   * @return string
   *   The server endpoint URI.
   */
  public function getEndpoint() {
    if (!isset($this->endPoint)) {
      $uri = Url::fromUri($GLOBALS['base_url'] . '/xmlrpc');
      $this->endPoint = $uri
        ->toUriString();
    }
    return $this->endPoint;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
XmlRpcTrait::$endPoint protected property The XML-RPC server endpoint.
XmlRpcTrait::getEndpoint public function Returns the URI of the server XML-RPC endpoint.