Endpoint specification

An endpoint contains the server location the client connects to the following endpoint types are currently supported (more to be added later):

  • tcp://host:port for tcp connections
  • unix://socket for UNIX sockets (provided the server supports this)
  • ssl://host:port for SSL connections (provided the server supports this)

Note: SSL support is added in ArangoDB server 1.1


package ArangoDBClient
since 0.2

 Methods

Create a new endpoint

__construct(string $value) 

Parameters

$value

string
  • endpoint specification

Exceptions

\ArangoDBClient\ClientException

Return a string representation of the endpoint

__toString() : string
magic

Returns

string- string representation of the endpoint

Return the host name of an endpoint

getHost(string $value) : string
Static

Parameters

$value

string
  • endpoint specification value

Returns

string- host name

Return the type of an endpoint

getType(string $value) : string
Static

Parameters

$value

string
  • endpoint specification value

Returns

string- endpoint type

check whether an endpoint specification is valid

isValid($value) : boolean
Static

Parameters

$value

Returns

boolean- true if endpoint specification is valid, false otherwise

List endpoints

listEndpoints(\ArangoDBClient\Connection $connection) : array
Static

This will list the endpoints that are configured on the server

link https://docs.arangodb.com/HTTP/Endpoints/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\Exception

Returns

array$responseArray - The response array.

Return normalize an endpoint string - will convert http: into tcp:, and https: into ssl:

normalize(string $value) : string
Static

Parameters

$value

string
  • endpoint string

Returns

string- normalized endpoint string

Replaces "localhost" in hostname with "[::1]" in order to make these values the same for later comparisons

normalizeHostname(string $hostname) : string
Static

Parameters

$hostname

string
  • hostname

Returns

string- normalized hostname

 Properties

 

Current endpoint value

$_value : string

Default

 Constants

 

Databases index

ENTRY_DATABASES = 'databases' 
 

Endpoint index

ENTRY_ENDPOINT = 'endpoint' 
 

Regexp for SSL endpoints

REGEXP_SSL = '/^(ssl|https):\/\/(.+?):(\d+)\/?$/' 
 

Regexp for TCP endpoints

REGEXP_TCP = '/^(tcp|http):\/\/(.+?):(\d+)\/?$/' 
 

Regexp for UNIX socket endpoints

REGEXP_UNIX = '/^unix:\/\/(.+)$/' 
 

SSL endpoint type

TYPE_SSL = 'ssl' 
 

TCP endpoint type

TYPE_TCP = 'tcp' 
 

UNIX socket endpoint type

TYPE_UNIX = 'unix'