From c4c9b29e8828789e888ebc6d4d2606c9272297b1 Mon Sep 17 00:00:00 2001 From: _alvian Date: Tue, 3 Oct 2017 06:20:15 +0700 Subject: [PATCH 01/13] enhance connection based on new class in arangodb php --- Connection.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Connection.php b/Connection.php index 8b4fb08..4ce3d20 100644 --- a/Connection.php +++ b/Connection.php @@ -4,7 +4,8 @@ namespace explosivebit\arangodb; use Yii; use triagens\ArangoDb\CollectionHandler; -use triagens\ArangoDb\ConnectionOptions; +//use triagens\ArangoDb\ConnectionOptions; +use ArangoDBClient\ConnectionOptions; use triagens\ArangoDb\Document; use triagens\ArangoDb\DocumentHandler; use triagens\ArangoDb\Statement; @@ -51,9 +52,9 @@ class Connection extends Object try { Yii::info($token, 'explosivebit\arangodb\Connection::open'); Yii::beginProfile($token, 'explosivebit\arangodb\Connection::open'); - $this->connection = new \triagens\ArangoDb\Connection($this->connectionOptions); - $this->collectionHandler = new CollectionHandler($this->connection); - $this->documentHandler = new DocumentHandler($this->connection); + $this->connection = new \ArangoDBClient\Connection($this->connectionOptions); + $this->collectionHandler = new \ArangoDBClient\CollectionHandler($this->connection); + $this->documentHandler = new \ArangoDBClient\DocumentHandler($this->connection); Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); } catch (\Exception $ex) { Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); @@ -102,6 +103,6 @@ class Connection extends Object */ public function getStatement($options = []) { - return new Statement($this->connection, $options); + return new \ArangoDBClient\Statement($this->connection, $options); } } From 094e92df664df2bc324b1ebaaf8a594f644ca0ce Mon Sep 17 00:00:00 2001 From: _alvian Date: Tue, 3 Oct 2017 07:34:02 +0700 Subject: [PATCH 02/13] enhance query based on arangodb 3.2 --- Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Query.php b/Query.php index eb6838e..4d449a4 100644 --- a/Query.php +++ b/Query.php @@ -3,8 +3,8 @@ namespace explosivebit\arangodb; use Yii; -use triagens\ArangoDb\Document; -use triagens\ArangoDb\Statement; +use ArangoDBClient\Document; +use ArangoDBClient\Statement; use yii\base\Component; use yii\base\InvalidParamException; use yii\base\NotSupportedException; From 2f4c725b512ef71e497efd865fdbe5c57657b6a7 Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 11:12:05 +0700 Subject: [PATCH 03/13] change composer package definition --- composer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0e4c6bd..5a16e14 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "explosivebit/yii2-arangodb", + "name": "elfarqy/yii2-arangodb", "description": "Yii2 arangodb components", "type": "yii2-extension", "keywords": ["yii2","arangodb"], @@ -8,12 +8,16 @@ { "name": "Ilya Rumyantsev", "email": "explosivebit@gmail.com" + }, + { + "name": "Alvian Burhanuddin", + "email": "alvianthelfarqy@gmail.com" } ], "minimum-stability": "dev", "require": { "yiisoft/yii2": "*", - "triagens/arangodb": "*" + "triagens/arangodb": "~3.2" }, "require-dev": { "yiisoft/yii2-debug": "*" @@ -23,4 +27,4 @@ "explosivebit\\arangodb\\": "" } } -} \ No newline at end of file +} From 9c704db451057887936ebd1ee4ad3e1298558b3f Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 11:19:40 +0700 Subject: [PATCH 04/13] fixing connection use --- Connection.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Connection.php b/Connection.php index 4ce3d20..d779e5a 100644 --- a/Connection.php +++ b/Connection.php @@ -3,13 +3,13 @@ namespace explosivebit\arangodb; use Yii; -use triagens\ArangoDb\CollectionHandler; -//use triagens\ArangoDb\ConnectionOptions; +use ArangoDBClient\CollectionHandler; use ArangoDBClient\ConnectionOptions; -use triagens\ArangoDb\Document; -use triagens\ArangoDb\DocumentHandler; -use triagens\ArangoDb\Statement; -use triagens\ArangoDb\UpdatePolicy; +use ArangoDBClient\Document; +use ArangoDBClient\DocumentHandler; +use ArangoDBClient\Statement; +use ArangoDBClient\UpdatePolicy; + use yii\base\Object; @@ -53,8 +53,8 @@ class Connection extends Object Yii::info($token, 'explosivebit\arangodb\Connection::open'); Yii::beginProfile($token, 'explosivebit\arangodb\Connection::open'); $this->connection = new \ArangoDBClient\Connection($this->connectionOptions); - $this->collectionHandler = new \ArangoDBClient\CollectionHandler($this->connection); - $this->documentHandler = new \ArangoDBClient\DocumentHandler($this->connection); + $this->collectionHandler = new CollectionHandler($this->connection); + $this->documentHandler = new DocumentHandler($this->connection); Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); } catch (\Exception $ex) { Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); @@ -103,6 +103,6 @@ class Connection extends Object */ public function getStatement($options = []) { - return new \ArangoDBClient\Statement($this->connection, $options); + return new Statement($this->connection, $options); } } From 6ccd02730c3be3d8904c080766152077c997a301 Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 13:07:02 +0700 Subject: [PATCH 05/13] fix import class in connection --- Connection.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Connection.php b/Connection.php index 8b4fb08..d779e5a 100644 --- a/Connection.php +++ b/Connection.php @@ -3,12 +3,13 @@ namespace explosivebit\arangodb; use Yii; -use triagens\ArangoDb\CollectionHandler; -use triagens\ArangoDb\ConnectionOptions; -use triagens\ArangoDb\Document; -use triagens\ArangoDb\DocumentHandler; -use triagens\ArangoDb\Statement; -use triagens\ArangoDb\UpdatePolicy; +use ArangoDBClient\CollectionHandler; +use ArangoDBClient\ConnectionOptions; +use ArangoDBClient\Document; +use ArangoDBClient\DocumentHandler; +use ArangoDBClient\Statement; +use ArangoDBClient\UpdatePolicy; + use yii\base\Object; @@ -51,7 +52,7 @@ class Connection extends Object try { Yii::info($token, 'explosivebit\arangodb\Connection::open'); Yii::beginProfile($token, 'explosivebit\arangodb\Connection::open'); - $this->connection = new \triagens\ArangoDb\Connection($this->connectionOptions); + $this->connection = new \ArangoDBClient\Connection($this->connectionOptions); $this->collectionHandler = new CollectionHandler($this->connection); $this->documentHandler = new DocumentHandler($this->connection); Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); From 7d44b5fa7b34a7d8e3c86589edd8f5980d6f3c2d Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 13:07:27 +0700 Subject: [PATCH 06/13] git fix class using in Query --- Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Query.php b/Query.php index eb6838e..4d449a4 100644 --- a/Query.php +++ b/Query.php @@ -3,8 +3,8 @@ namespace explosivebit\arangodb; use Yii; -use triagens\ArangoDb\Document; -use triagens\ArangoDb\Statement; +use ArangoDBClient\Document; +use ArangoDBClient\Statement; use yii\base\Component; use yii\base\InvalidParamException; use yii\base\NotSupportedException; From 24ff4cd6971e97107e5943ec1851c612b4ab84a5 Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 13:07:44 +0700 Subject: [PATCH 07/13] git fix name and dependencies --- composer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0e4c6bd..125d578 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "explosivebit/yii2-arangodb", + "name": "akupeduli/yii2-arangodb", "description": "Yii2 arangodb components", "type": "yii2-extension", "keywords": ["yii2","arangodb"], @@ -8,12 +8,16 @@ { "name": "Ilya Rumyantsev", "email": "explosivebit@gmail.com" + }, + { + "name": "Alvian Burhanuddin", + "email": "alvianthelfarqy@gmail.com" } ], "minimum-stability": "dev", "require": { "yiisoft/yii2": "*", - "triagens/arangodb": "*" + "triagens/arangodb": "~3.2" }, "require-dev": { "yiisoft/yii2-debug": "*" @@ -23,4 +27,4 @@ "explosivebit\\arangodb\\": "" } } -} \ No newline at end of file +} From addcb6ee18f146eef28711cf16dc368530b87a49 Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 13:12:10 +0700 Subject: [PATCH 08/13] fix config in main --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 35399b8..056983c 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ return [ 'arangodb' => [ 'class' => '\explosivebit\arangodb\Connection', 'connectionOptions' => [ - triagens\ArangoDb\ConnectionOptions::OPTION_DATABASE => "mydatabase", - triagens\ArangoDb\ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529', - triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', - //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_USER => '', - //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_PASSWD => '', + ArangoDBClient\ConnectionOptions::OPTION_DATABASE => "mydatabase", + ArangoDBClient\ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529', + ArangoDBClient\ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', + //ArangoDBClient\ConnectionOptions::OPTION_AUTH_USER => '', + //ArangoDBClient\ConnectionOptions::OPTION_AUTH_PASSWD => '', ], ], ], From 75b00ccc59eec1e10947f3a8a0981bdda700ba4d Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 9 Oct 2017 14:16:41 +0700 Subject: [PATCH 09/13] fixing configuration in main --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 35399b8..f63c98b 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ return [ 'arangodb' => [ 'class' => '\explosivebit\arangodb\Connection', 'connectionOptions' => [ - triagens\ArangoDb\ConnectionOptions::OPTION_DATABASE => "mydatabase", - triagens\ArangoDb\ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529', - triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', - //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_USER => '', - //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_PASSWD => '', + ArangoDBClient\ConnectionOptions::OPTION_DATABASE => "mydatabase", + ArangoDBClient\ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529', + ArangoDBClient\ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', + //ArangoDBClient\ConnectionOptions::OPTION_AUTH_USER => '', + //ArangoDBClient\ConnectionOptions::OPTION_AUTH_PASSWD => '', ], ], ], From d0649796c59e0152007d2ea56fda74fbb6abcbdf Mon Sep 17 00:00:00 2001 From: _alvian Date: Fri, 10 Nov 2017 15:33:59 +0700 Subject: [PATCH 10/13] change deprecated object to baseobject --- Connection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Connection.php b/Connection.php index d779e5a..63fd183 100644 --- a/Connection.php +++ b/Connection.php @@ -10,10 +10,9 @@ use ArangoDBClient\DocumentHandler; use ArangoDBClient\Statement; use ArangoDBClient\UpdatePolicy; +use yii\base\BaseObject; -use yii\base\Object; - -class Connection extends Object +class Connection extends BaseObject { private $connection = null; @@ -106,3 +105,4 @@ class Connection extends Object return new Statement($this->connection, $options); } } + From 91f93ca8a03e5748f71cd865141ed96a2aa925fc Mon Sep 17 00:00:00 2001 From: _alvian Date: Wed, 6 Dec 2017 10:12:19 +0700 Subject: [PATCH 11/13] Add connectionHandler and export params --- Connection.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Connection.php b/Connection.php index 63fd183..b68c6aa 100644 --- a/Connection.php +++ b/Connection.php @@ -2,6 +2,8 @@ namespace explosivebit\arangodb; +use ArangoDBClient\EdgeHandler; +use ArangoDBClient\Export; use Yii; use ArangoDBClient\CollectionHandler; use ArangoDBClient\ConnectionOptions; @@ -42,6 +44,8 @@ class Connection extends BaseObject private $collectionHandler = null; /** @var null|DocumentHandler $documentHandler */ private $documentHandler = null; + /** @var null|EdgeHandler $documentHandler */ + private $edgeHandler = null; public function init() { @@ -51,13 +55,14 @@ class Connection extends BaseObject try { Yii::info($token, 'explosivebit\arangodb\Connection::open'); Yii::beginProfile($token, 'explosivebit\arangodb\Connection::open'); - $this->connection = new \ArangoDBClient\Connection($this->connectionOptions); + $this->connection = new \ArangoDBClient\Connection($this->connectionOptions); $this->collectionHandler = new CollectionHandler($this->connection); - $this->documentHandler = new DocumentHandler($this->connection); + $this->documentHandler = new DocumentHandler($this->connection); + $this->edgeHandler = new EdgeHandler($this->connection); Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); } catch (\Exception $ex) { Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); - throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex); + throw new \Exception($ex->getMessage(), (int)$ex->getCode(), $ex); } } @@ -86,6 +91,14 @@ class Connection extends BaseObject return $this->documentHandler; } + /** + * @return null|EdgeHandler + */ + public function getEdgeHandler() + { + return $this->edgeHandler; + } + /** * @param $collectionId * @param $documentId @@ -104,5 +117,12 @@ class Connection extends BaseObject { return new Statement($this->connection, $options); } -} + /** + * @param array $options + * @return Export + */ + public function getExport($options = []) { + return new Export($this->connection, $options); + } +} From 183b2c6343b727ac12f491d51af4525ad38f1072 Mon Sep 17 00:00:00 2001 From: _alvian Date: Mon, 11 Dec 2017 10:51:07 +0700 Subject: [PATCH 12/13] fixing composer json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 125d578..5a16e14 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "akupeduli/yii2-arangodb", + "name": "elfarqy/yii2-arangodb", "description": "Yii2 arangodb components", "type": "yii2-extension", "keywords": ["yii2","arangodb"], From 858e86bfab9948c752ac5876e6a386ae082e1192 Mon Sep 17 00:00:00 2001 From: _alvian Date: Fri, 22 Dec 2017 13:55:09 +0700 Subject: [PATCH 13/13] add graphHandler --- Connection.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Connection.php b/Connection.php index b68c6aa..a99708c 100644 --- a/Connection.php +++ b/Connection.php @@ -4,6 +4,7 @@ namespace explosivebit\arangodb; use ArangoDBClient\EdgeHandler; use ArangoDBClient\Export; +use ArangoDBClient\GraphHandler; use Yii; use ArangoDBClient\CollectionHandler; use ArangoDBClient\ConnectionOptions; @@ -46,6 +47,8 @@ class Connection extends BaseObject private $documentHandler = null; /** @var null|EdgeHandler $documentHandler */ private $edgeHandler = null; + /** @var null|EdgeHandler $graphHandler */ + private $graphHandler = null; public function init() { @@ -59,6 +62,7 @@ class Connection extends BaseObject $this->collectionHandler = new CollectionHandler($this->connection); $this->documentHandler = new DocumentHandler($this->connection); $this->edgeHandler = new EdgeHandler($this->connection); + $this->graphHandler = new GraphHandler($this->connection); Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); } catch (\Exception $ex) { Yii::endProfile($token, 'explosivebit\arangodb\Connection::open'); @@ -66,6 +70,14 @@ class Connection extends BaseObject } } + /** + * @return EdgeHandler|null + */ + public function getGraphHandler(): EdgeHandler + { + return $this->graphHandler; + } + /** * @return null|CollectionHandler */