ArangoDB-PHP-Core API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • frankmayer
    • ArangoDbPhpCore
      • Api
        • Rest
      • Config
      • Connectors
      • Plugins
      • Protocols
        • Http
      • TraitRepository

Classes

  • frankmayer\ArangoDbPhpCore\Api\Rest\Api
  • frankmayer\ArangoDbPhpCore\Api\Rest\Async
  • frankmayer\ArangoDbPhpCore\Api\Rest\Batch
  • frankmayer\ArangoDbPhpCore\Api\Rest\Collection
  • frankmayer\ArangoDbPhpCore\Api\Rest\Database
  • frankmayer\ArangoDbPhpCore\Api\Rest\Document
  • frankmayer\ArangoDbPhpCore\Api\Rest\DocumentBase
  • frankmayer\ArangoDbPhpCore\Api\Rest\Edge
  • frankmayer\ArangoDbPhpCore\Autoloader
  • frankmayer\ArangoDbPhpCore\Client
  • frankmayer\ArangoDbPhpCore\ClientOptions
  • frankmayer\ArangoDbPhpCore\Config\ConnectionOptions
  • frankmayer\ArangoDbPhpCore\Config\DefaultValues
  • frankmayer\ArangoDbPhpCore\Config\Endpoint
  • frankmayer\ArangoDbPhpCore\Config\UpdatePolicy
  • frankmayer\ArangoDbPhpCore\Connectors\AbstractHttpConnector
  • frankmayer\ArangoDbPhpCore\Plugins\Plugin
  • frankmayer\ArangoDbPhpCore\Plugins\PluginManager
  • frankmayer\ArangoDbPhpCore\Plugins\TestPlugin
  • frankmayer\ArangoDbPhpCore\Plugins\TracerPlugin
  • frankmayer\ArangoDbPhpCore\Protocols\Http\AbstractHttpRequest
  • frankmayer\ArangoDbPhpCore\Protocols\Http\HttpRequest
  • frankmayer\ArangoDbPhpCore\Protocols\Http\HttpResponse

Interfaces

  • frankmayer\ArangoDbPhpCore\Api\ApiInterface
  • frankmayer\ArangoDbPhpCore\Api\RestApiInterface
  • frankmayer\ArangoDbPhpCore\ClientInterface
  • frankmayer\ArangoDbPhpCore\ConnectorInterface
  • frankmayer\ArangoDbPhpCore\Plugins\PluginInterface
  • frankmayer\ArangoDbPhpCore\Protocols\Http\HttpConnectorInterface
  • frankmayer\ArangoDbPhpCore\Protocols\Http\HttpRequestInterface
  • frankmayer\ArangoDbPhpCore\Protocols\Http\HttpResponseInterface
  • frankmayer\ArangoDbPhpCore\Protocols\RequestInterface
  • frankmayer\ArangoDbPhpCore\Protocols\ResponseInterface

Traits

  • frankmayer\ArangoDbPhpCore\Api\Rest\DocumentTrait
  • frankmayer\ArangoDbPhpCore\Api\Rest\EdgeTrait
  • frankmayer\ArangoDbPhpCore\TraitRepository\ClientLogger

Exceptions

  • frankmayer\ArangoDbPhpCore\ClientException
  • frankmayer\ArangoDbPhpCore\ConnectionException
  • frankmayer\ArangoDbPhpCore\Exception
  • frankmayer\ArangoDbPhpCore\ServerException
  1 <?php
  2 
  3 /**
  4  * ArangoDB PHP Core Client: HTTP Request
  5  *
  6  * @author    Frank Mayer
  7  * @copyright Copyright 2013-2015, FRANKMAYER.NET, Athens, Greece
  8  */
  9 
 10 namespace frankmayer\ArangoDbPhpCore\Protocols\Http;
 11 
 12 
 13 /**
 14  * Class AbstractHttpRequest
 15  *
 16  * HTTP-Request object that holds a request. Requests are in some cases not directly passed to the server,
 17  * for instance when a request is destined for a batch.
 18  *
 19  * @package frankmayer\ArangoDbPhpCore\Protocols\Http
 20  */
 21 abstract class AbstractHttpRequest implements HttpRequestInterface
 22 {
 23     const METHOD_GET     = 'GET';
 24     const METHOD_POST    = 'POST';
 25     const METHOD_PUT     = 'PUT';
 26     const METHOD_PATCH   = 'PATCH';
 27     const METHOD_DELETE  = 'DELETE';
 28     const METHOD_HEAD    = 'HEAD';
 29     const METHOD_OPTIONS = 'OPTIONS';
 30 
 31     const API_BATCH = '/_api/batch';
 32 
 33 
 34     /**
 35      * @var \frankmayer\ArangoDbPhpCore\Client
 36      */
 37     public $client;
 38     /**
 39      * @var \frankmayer\ArangoDbPhpCore\ConnectorInterface
 40      */
 41     public $connector;
 42     /**
 43      * @var array
 44      */
 45     public $connectorOptions = [];
 46     /**
 47      * @var string The address of the endpoint
 48      */
 49     public $address;
 50     /**
 51      * @var string The path-part of the request
 52      */
 53     public $path;
 54     /**
 55      * @var string The Body of the request
 56      */
 57     public $body;
 58     /**
 59      * @var array The headers of the request
 60      */
 61     public $headers = [];
 62     /**
 63      * @var array The options of the request
 64      */
 65     public $options = [];
 66     /**
 67      * @var string The type of the request
 68      */
 69     public $type;
 70     /**
 71      * @var string The method of the request
 72      */
 73     public $method;
 74     /**
 75      * @var string The response data as a result of the request
 76      */
 77     public $response;
 78     /**
 79      * @var HttpResponseInterface The response-object as a result of the request
 80      */
 81     public $responseObject;
 82     /**
 83      * @var object The wrapped handler of communications.
 84      */
 85     public $handler;
 86     /**
 87      * @var string The boundary string for batch operations with ArangoDB
 88      */
 89     public $batchBoundary;
 90     /**
 91      * @var object flag for if the request is a batch request (this does not include the batchpart requests)
 92      */
 93     public $batch;
 94 
 95     /**
 96      * @param $client
 97      */
 98     function __construct($client)
 99     {
100         $this->client = $client;
101     }
102 
103 
104     /**
105      * Method to send an HTTP request.
106      * All request should be done through this method. Any async or batch handling is done within this method.
107      *
108      * @return HttpResponse Http Response object
109      */
110     public abstract function send();
111 
112 
113     /**
114      * Method to an HTTP batch request
115      *
116      * @param array  $batchParts
117      * @param string $boundary
118      *
119      * @return mixed
120      */
121 
122 
123     public abstract function sendBatch($batchParts = [], $boundary = 'XXXbXXX');
124 
125 
126     /**
127      * @param $urlQueryArray
128      *
129      * @return string
130      */
131     public function buildUrlQuery($urlQueryArray)
132     {
133         $params = [];
134         foreach ($urlQueryArray as $key => $value) {
135             $params[] = $key . '=' . $value;
136         }
137 
138         return '?' . implode('&', $params);
139     }
140 }
141 
ArangoDB-PHP-Core API Documentation API documentation generated by ApiGen