From 8bcf826c25560c23e392b1094d1aae8a8e60682d Mon Sep 17 00:00:00 2001 From: bethrezen Date: Mon, 16 Jun 2014 15:03:26 +0400 Subject: [PATCH] Workaround for empty example document bug --- ArangoDbConnection.php | 4 ++-- Connection.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Connection.php diff --git a/ArangoDbConnection.php b/ArangoDbConnection.php index 0922f24..37d7d76 100644 --- a/ArangoDbConnection.php +++ b/ArangoDbConnection.php @@ -6,7 +6,7 @@ use yii\helpers\ArrayHelper; use yii\base\Object; // set up some aliases for less typing later -use triagens\ArangoDb\Connection as ArangoConnection; + use triagens\ArangoDb\ConnectionOptions as ArangoConnectionOptions; use triagens\ArangoDb\DocumentHandler as ArangoDocumentHandler; @@ -53,7 +53,7 @@ class ArangoDbConnection extends Object { { parent::init(); - $this->_connection = new ArangoConnection($this->connectionOptions); + $this->_connection = new Connection($this->connectionOptions); $this->_collectionHandler = new \triagens\ArangoDb\CollectionHandler($this->_connection); $this->_documentHandler = new \triagens\ArangoDb\DocumentHandler($this->_connection); } diff --git a/Connection.php b/Connection.php new file mode 100644 index 0000000..1868ea1 --- /dev/null +++ b/Connection.php @@ -0,0 +1,19 @@ +getOption(ConnectionOptions::OPTION_CHECK_UTF8_CONFORM) === true) { + self::check_encoding($data); + } + + + $response = json_encode($data, $options | JSON_FORCE_OBJECT); + + return $response; + } +} \ No newline at end of file