Provides access to the ArangoDB server
As all access is done using HTTP, we do not need to establish a
persistent connection and keep its state.
Instead, connections are established on the fly for each request
and are destroyed afterwards.
| package | ArangoDBClient |
|---|---|
| since | 0.2 |
__construct(array $options)
array\ArangoDBClient\Exception |
|---|
__destruct() : void
check_encoding(array $data)
It will raise an exception if it encounters wrong encoded strings.
arraythe data to check
\ArangoDBClient\ClientException |
|---|
delete(string $url, array $customHeaders= array(), string $data= '') : \ArangoDBClient\HttpResponse
stringarray
string\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsedetect_utf(array $string) : boolean
It only checks for printable characters.
arraythe data to check
booleantrue if string is UTF-8, false if notget(string $url, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
stringarray
\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsegetActiveBatch() : \ArangoDBClient\Batch
\ArangoDBClient\Batchactive batchgetBatches()
getCurrentEndpoint() : string
string- the current endpoint that we are connected togetDatabase() : string
stringgetOption(string $name) : mixed
string\ArangoDBClient\ClientException |
|---|
mixedgetOptions() : \ArangoDBClient\ConnectionOptions
\ArangoDBClient\ConnectionOptionshead(string $url, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
stringarray
\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponseisInBatchCaptureMode() : boolean
booleanjson_encode_wrapper(mixed $data, mixed $options = 0) : string
internally it calls the check_encoding() method. If that method does not throw an Exception, this method will happily return the json_encoded data.
mixedthe data to encode
mixedthe options for the json_encode() call
\ArangoDBClient\ClientException |
|---|
stringthe result of the json_encodeparseResponse(\ArangoDBClient\HttpResponse $response) : \ArangoDBClient\HttpResponse
\ArangoDBClient\HttpResponse\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsepatch(string $url, string $data, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
stringstringarray
\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsepost(string $url, string $data, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
stringstringarray
\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponseput(string $url, string $data, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
stringstringarray
\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsesetActiveBatch(\ArangoDBClient\Batch $batch) : \ArangoDBClient\Batch
\ArangoDBClient\Batch\ArangoDBClient\Batchactive batchsetBatchRequest(boolean $state)
booleansets the connection state to batch request, meaning it is currently doing a batch request.
setCaptureBatch(boolean $state)
booleantrue to turn on capture batch mode, false to turn it off
setDatabase(string $database)
Sets the database to use with this connection, for example: 'my_database'
Further calls to the database will be addressed to the given database.
stringthe database to use
setOption(string $name, string $value)
stringstring\ArangoDBClient\ClientException |
|---|
stopCaptureBatch() : \ArangoDBClient\Batch
\ArangoDBClient\Batch- Returns the active batch objecttest() : boolean
boolean- true if the connection succeeds, false if notcloseHandle() : void
doBatch(mixed $method, string $request) : mixed
mixedstringThis checks if we're in batch mode and returns a placeholder object, since we need to return some object that is expected by the caller. if we're not in batch mode it does not return anything, and
\ArangoDBClient\ClientException |
|---|
mixedBatchpart or null if not in batch capturing modeexecuteRequest(string $method, string $url, string $data, array $customHeaders = array()) : \ArangoDBClient\HttpResponse
This function will throw if no connection to the server can be established or if there is a problem during data exchange with the server.
will restore it.
stringstringstringarray\ArangoDBClient\Exception |
|---|
\ArangoDBClient\HttpResponsegetHandle() : resource
If keep-alive connections are used, the handle will be stored and re-used
\ArangoDBClient\ClientException |
|
|---|---|
\ArangoDBClient\ConnectException |
resource- connection handlehandleFailover(mixed $cb) : \ArangoDBClient\HttpResponse
mixed\ArangoDBClient\Exception |
- either a ConnectException or a FailoverException or an Exception produced by the callback function |
|---|
\ArangoDBClient\HttpResponsenotify($message) : void
updateHttpHeader()
$_activeBatch : \ArangoDBClient\Batch
$_baseUrl : string
''$_batchRequest : boolean
false$_batches : array
array()$_captureBatch : boolean
false$_database : string
''$_handle : resource
$_httpHeader : string
''$_useKeepAlive : boolean