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.
array
the data to check
\ArangoDBClient\ClientException |
---|
delete(string $url, array $customHeaders= array()
, string $data= ''
) : \ArangoDBClient\HttpResponse
string
array
string
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
detect_utf(array $string) : boolean
It only checks for printable characters.
array
the data to check
boolean
true if string is UTF-8, false if notget(string $url, array $customHeaders = array()
) : \ArangoDBClient\HttpResponse
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
getActiveBatch() : \ArangoDBClient\Batch
\ArangoDBClient\Batch
active batchgetBatches()
getCurrentEndpoint() : string
string
- the current endpoint that we are connected togetDatabase() : string
string
getOption(string $name) : mixed
string
\ArangoDBClient\ClientException |
---|
mixed
getOptions() : \ArangoDBClient\ConnectionOptions
\ArangoDBClient\ConnectionOptions
head(string $url, array $customHeaders = array()
) : \ArangoDBClient\HttpResponse
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
isInBatchCaptureMode() : boolean
boolean
json_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.
mixed
the data to encode
mixed
the options for the json_encode() call
\ArangoDBClient\ClientException |
---|
string
the result of the json_encodeparseResponse(\ArangoDBClient\HttpResponse $response) : \ArangoDBClient\HttpResponse
\ArangoDBClient\HttpResponse
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
patch(string $url, string $data, array $customHeaders = array()
) : \ArangoDBClient\HttpResponse
string
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
post(string $url, string $data, array $customHeaders = array()
) : \ArangoDBClient\HttpResponse
string
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
put(string $url, string $data, array $customHeaders = array()
) : \ArangoDBClient\HttpResponse
string
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
setActiveBatch(\ArangoDBClient\Batch $batch) : \ArangoDBClient\Batch
\ArangoDBClient\Batch
\ArangoDBClient\Batch
active batchsetBatchRequest(boolean $state)
boolean
sets the connection state to batch request, meaning it is currently doing a batch request.
setCaptureBatch(boolean $state)
boolean
true 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.
string
the database to use
setOption(string $name, string $value)
string
string
\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
mixed
string
This 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 |
---|
mixed
Batchpart 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.
string
string
string
array
\ArangoDBClient\Exception |
---|
\ArangoDBClient\HttpResponse
getHandle() : 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\HttpResponse
notify($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