Location: PHPKode > projects > ArangoDB-PHP > ArangoDB-PHP-1.0.1/docs/classes/triagens.ArangoDb.Connection.html
<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>ArangoDB PHP client API » \triagens\ArangoDb\Connection</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">ArangoDB PHP client API</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Namespaces</a></li>
<li><a href="../namespaces/triagens.html"><i class="icon-th"></i> triagens</a></li>
<li><a>Packages</a></li>
<li><a href="../packages/ArangoDbPhpClient.html"><i class="icon-folder-open"></i> ArangoDbPhpClient</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">0</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">9</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods
                    <ul>
<li class="method public "><a href="#method___construct" title="__construct :: Set up the connection object, validate the options provided"><span class="description">Set up the connection object, validate the options provided</span><pre>__construct()</pre></a></li>
<li class="method public "><a href="#method___destruct" title="__destruct :: Close existing connection handle if a keep-alive connection was used"><span class="description">Close existing connection handle if a keep-alive connection was used</span><pre>__destruct()</pre></a></li>
<li class="method public "><a href="#method_delete" title="delete :: Issue an HTTP DELETE request with the data provided"><span class="description">Issue an HTTP DELETE request with the data provided</span><pre>delete()</pre></a></li>
<li class="method public "><a href="#method_get" title="get :: Issue an HTTP GET request"><span class="description">Issue an HTTP GET request</span><pre>get()</pre></a></li>
<li class="method public "><a href="#method_getOption" title="getOption :: Get an option set for the connection"><span class="description">Get an option set for the connection</span><pre>getOption()</pre></a></li>
<li class="method public "><a href="#method_getVersion" title="getVersion :: Get the client api version"><span class="description">Get the client api version</span><pre>getVersion()</pre></a></li>
<li class="method public "><a href="#method_patch" title="patch :: Issue an HTTP PATCH request with the data provided"><span class="description">Issue an HTTP PATCH request with the data provided</span><pre>patch()</pre></a></li>
<li class="method public "><a href="#method_post" title="post :: Issue an HTTP POST request with the data provided"><span class="description">Issue an HTTP POST request with the data provided</span><pre>post()</pre></a></li>
<li class="method public "><a href="#method_put" title="put :: Issue an HTTP PUT request with the data provided"><span class="description">Issue an HTTP PUT request with the data provided</span><pre>put()</pre></a></li>
</ul>
</li>
<li class="nav-header private">» Private
                    <ul>
<li class="method private "><a href="#method_executeRequest" title="executeRequest :: Execute an HTTP request and return the results"><span class="description">Execute an HTTP request and return the results</span><pre>executeRequest()</pre></a></li>
<li class="method private "><a href="#method_getHandle" title="getHandle :: Get a connection handle"><span class="description">Get a connection handle</span><pre>getHandle()</pre></a></li>
<li class="method private "><a href="#method_parseResponse" title="parseResponse :: Parse the response return the body values as an assoc array"><span class="description">Parse the response return the body values as an assoc array</span><pre>parseResponse()</pre></a></li>
</ul>
</li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties
                    <ul><li class="property public "><a href="#property__apiVersion" title="$_apiVersion :: Api Version"><span class="description">Api Version</span><pre>$_apiVersion</pre></a></li></ul>
</li>
<li class="nav-header private">» Private
                    <ul>
<li class="property private "><a href="#property__handle" title="$_handle :: Connection handle, used in case of keep-alive"><span class="description">Connection handle, used in case of keep-alive</span><pre>$_handle</pre></a></li>
<li class="property private "><a href="#property__options" title="$_options :: Connection options"><span class="description">Connection options</span><pre>$_options</pre></a></li>
<li class="property private "><a href="#property__useKeepAlive" title="$_useKeepAlive :: Flag if keep-alive connections are used"><span class="description">Flag if keep-alive connections are used</span><pre>$_useKeepAlive</pre></a></li>
</ul>
</li>
</ul>
</div>
<div class="span8">
<a id="\triagens\ArangoDb\Connection"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/triagens.html">triagens</a></li>
<li>
<span class="divider">\</span><a href="../namespaces/triagens.ArangoDb.html">ArangoDb</a>
</li>
<li class="active">
<span class="divider">\</span><a href="../classes/triagens.ArangoDb.Connection.html">Connection</a>
</li>
</ul>
<div class="element class">
<p class="short_description">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.</p>
<div class="details">
<div class="long_description"><p>Instead, connections are established on the fly for each request
and are destroyed afterwards.</p></div>
<table class="table table-bordered"><tr>
<th>package</th>
<td><a href="../packages/ArangoDbPhpClient.html">ArangoDbPhpClient</a></td>
</tr></table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a id="method___construct"></a><div class="element clickable method public method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
<h2>Set up the connection object, validate the options provided</h2>
<pre>__construct(array $options) : void</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$options</h4>
<code>array</code><ul>
<li>initial connection options</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
</div></div>
</div>
<a id="method___destruct"></a><div class="element clickable method public method___destruct" data-toggle="collapse" data-target=".method___destruct .collapse">
<h2>Close existing connection handle if a keep-alive connection was used</h2>
<pre>__destruct() : void</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="method_delete"></a><div class="element clickable method public method_delete" data-toggle="collapse" data-target=".method_delete .collapse">
<h2>Issue an HTTP DELETE request with the data provided</h2>
<pre>delete(string $url) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>DELETE URL</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_get"></a><div class="element clickable method public method_get" data-toggle="collapse" data-target=".method_get .collapse">
<h2>Issue an HTTP GET request</h2>
<pre>get(string $url) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>GET URL</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_getOption"></a><div class="element clickable method public method_getOption" data-toggle="collapse" data-target=".method_getOption .collapse">
<h2>Get an option set for the connection</h2>
<pre>getOption(string $name) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$name</h4>
<code>string</code><p>name - name of option</p>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.ClientException.html">\triagens\ArangoDb\ClientException</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code>mixed</code></div>
</div></div>
</div>
<a id="method_getVersion"></a><div class="element clickable method public method_getVersion" data-toggle="collapse" data-target=".method_getVersion .collapse">
<h2>Get the client api version</h2>
<pre>getVersion() : string</pre>
<div class="labels"><span class="label">Static</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_patch"></a><div class="element clickable method public method_patch" data-toggle="collapse" data-target=".method_patch .collapse">
<h2>Issue an HTTP PATCH request with the data provided</h2>
<pre>patch(string $url, string $data) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>PATCH URL</li>
</ul>
</div>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code><ul>
<li>patch body</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_post"></a><div class="element clickable method public method_post" data-toggle="collapse" data-target=".method_post .collapse">
<h2>Issue an HTTP POST request with the data provided</h2>
<pre>post(string $url, string $data) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>POST URL</li>
</ul>
</div>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code><ul>
<li>body to post</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_put"></a><div class="element clickable method public method_put" data-toggle="collapse" data-target=".method_put .collapse">
<h2>Issue an HTTP PUT request with the data provided</h2>
<pre>put(string $url, string $data) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>PUT URL</li>
</ul>
</div>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code><ul>
<li>body to post</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_executeRequest"></a><div class="element clickable method private method_executeRequest" data-toggle="collapse" data-target=".method_executeRequest .collapse">
<h2>Execute an HTTP request and return the results</h2>
<pre>executeRequest(string $method, string $url, string $data) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>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.</p>

<p>The function might temporarily alter the value of the php.ini value 'default_socket_timeout' but
will restore it.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$method</h4>
<code>string</code><ul>
<li>HTTP request method</li>
</ul>
</div>
<div class="subelement argument">
<h4>$url</h4>
<code>string</code><ul>
<li>HTTP URL</li>
</ul>
</div>
<div class="subelement argument">
<h4>$data</h4>
<code>string</code><ul>
<li>data to post in body</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<a id="method_getHandle"></a><div class="element clickable method private method_getHandle" data-toggle="collapse" data-target=".method_getHandle .collapse">
<h2>Get a connection handle</h2>
<pre>getHandle() : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>If keep-alive connections are used, the handle will be stored and re-used</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>resource</code>- connection handle</div>
</div></div>
</div>
<a id="method_parseResponse"></a><div class="element clickable method private method_parseResponse" data-toggle="collapse" data-target=".method_parseResponse .collapse">
<h2>Parse the response return the body values as an assoc array</h2>
<pre>parseResponse(\triagens\ArangoDb\HttpResponse $response) : <a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$response</h4>
<code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code><ul>
<li>the response as supplied by the server</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/triagens.ArangoDb.HttpResponse.html">\triagens\ArangoDb\HttpResponse</a></code></div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a id="property__apiVersion"> </a><div class="element clickable property public property__apiVersion" data-toggle="collapse" data-target=".property__apiVersion .collapse">
<h2>Api Version</h2>
<pre>$_apiVersion : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__handle"> </a><div class="element clickable property private property__handle" data-toggle="collapse" data-target=".property__handle .collapse">
<h2>Connection handle, used in case of keep-alive</h2>
<pre>$_handle : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__options"> </a><div class="element clickable property private property__options" data-toggle="collapse" data-target=".property__options .collapse">
<h2>Connection options</h2>
<pre>$_options : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__useKeepAlive"> </a><div class="element clickable property private property__useKeepAlive" data-toggle="collapse" data-target=".property__useKeepAlive .collapse">
<h2>Flag if keep-alive connections are used</h2>
<pre>$_useKeepAlive : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a10</a> and<br>
            generated on 2012-12-05T20:49:15+02:00.<br></footer></div>
</div>
</body>
</html>
Return current item: ArangoDB-PHP