Workaround for empty example document bug

This commit is contained in:
bethrezen 2014-06-16 15:03:26 +04:00
parent 49ab837591
commit 8bcf826c25
2 changed files with 21 additions and 2 deletions

View File

@ -6,7 +6,7 @@ use yii\helpers\ArrayHelper;
use yii\base\Object; use yii\base\Object;
// set up some aliases for less typing later // set up some aliases for less typing later
use triagens\ArangoDb\Connection as ArangoConnection;
use triagens\ArangoDb\ConnectionOptions as ArangoConnectionOptions; use triagens\ArangoDb\ConnectionOptions as ArangoConnectionOptions;
use triagens\ArangoDb\DocumentHandler as ArangoDocumentHandler; use triagens\ArangoDb\DocumentHandler as ArangoDocumentHandler;
@ -53,7 +53,7 @@ class ArangoDbConnection extends Object {
{ {
parent::init(); parent::init();
$this->_connection = new ArangoConnection($this->connectionOptions); $this->_connection = new Connection($this->connectionOptions);
$this->_collectionHandler = new \triagens\ArangoDb\CollectionHandler($this->_connection); $this->_collectionHandler = new \triagens\ArangoDb\CollectionHandler($this->_connection);
$this->_documentHandler = new \triagens\ArangoDb\DocumentHandler($this->_connection); $this->_documentHandler = new \triagens\ArangoDb\DocumentHandler($this->_connection);
} }

19
Connection.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace devgroup\arangodb;
use \triagens\ArangoDb\ConnectionOptions;
class Connection extends \triagens\ArangoDb\Connection {
public function json_encode_wrapper($data, $options = null)
{
if ($this->getOption(ConnectionOptions::OPTION_CHECK_UTF8_CONFORM) === true) {
self::check_encoding($data);
}
$response = json_encode($data, $options | JSON_FORCE_OBJECT);
return $response;
}
}