Workaround for empty example document bug
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
19
Connection.php
Normal file
19
Connection.php
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user