Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a4be42cc82 | ||
![]() |
b1f31103eb | ||
![]() |
6c308b92e7 | ||
![]() |
0dd8e7da47 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/vendor
|
@@ -1,9 +1,13 @@
|
||||
{
|
||||
"name": "mirzaev/yii2-arangodb",
|
||||
"description": "Yii2 ArangoDB",
|
||||
"type": "library",
|
||||
"description": "Library for connecting ArangoDB-PHP to Yii2",
|
||||
"keywords": [
|
||||
"Yii2",
|
||||
"ArangoDB"
|
||||
],
|
||||
"type": "yii2-extension",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"homepage": "https://git.hood.su/mirzaev/yii2-arangodb",
|
||||
"homepage": "https://git.hood.su/mirzaev/yii2/arangodb",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Arsen Mirzaev Tatyano-Muradovich",
|
||||
@@ -12,16 +16,21 @@
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"homepage": "https://github.com/explosivebit/yii2-arangodb",
|
||||
"role": "Old fork (abandoned)"
|
||||
"name": "Ilya Rumyantsev",
|
||||
"email": "explosivebit@gmail.com"
|
||||
},
|
||||
{
|
||||
"homepage": "https://github.com/DevGroup-ru/yii2-arangodb",
|
||||
"role": "Original repository (abandoned)"
|
||||
"name": "Alvian Burhanuddin",
|
||||
"email": "alvianthelfarqy@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.0.0"
|
||||
"php": "^8.0.0",
|
||||
"yiisoft/yii2": "*",
|
||||
"triagens/arangodb": "~3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"yiisoft/yii2-debug": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -33,4 +42,4 @@
|
||||
"mirzaev\\yii2\\arangodb\\tests\\": "mirzaev/yii2-arangodb/tests"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
mirzaev/yii2-arangodb/.gitignore
vendored
3
mirzaev/yii2-arangodb/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
composer.phar
|
||||
composer.lock
|
||||
vendor
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use Yii;
|
||||
use yii\db\ActiveQueryInterface;
|
||||
@@ -104,14 +104,14 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
{
|
||||
$statement = $this->createCommand($db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
$cursor = $statement->execute();
|
||||
$rows = $cursor->getAll();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
if (!empty($rows)) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use Yii;
|
||||
use yii\base\InvalidConfigException;
|
||||
|
@@ -1,11 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* User: evgen-d
|
||||
* Date: 08.10.14
|
||||
* Time: 16:00
|
||||
*/
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use yii\base\Object;
|
||||
|
||||
@@ -37,4 +32,3 @@ class AqlExpression extends Object
|
||||
return $this->expression;
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use ArangoDBClient\EdgeHandler;
|
||||
use ArangoDBClient\Export;
|
||||
@@ -56,16 +56,16 @@ class Connection extends BaseObject
|
||||
|
||||
$token = 'Opening ArangoDB connection: ' . $this->connectionOptions[ConnectionOptions::OPTION_ENDPOINT];
|
||||
try {
|
||||
Yii::info($token, 'explosivebit\arangodb\Connection::open');
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Connection::open');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Connection::open');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Connection::open');
|
||||
$this->connection = new \ArangoDBClient\Connection($this->connectionOptions);
|
||||
$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');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Connection::open');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Connection::open');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Connection::open');
|
||||
throw new \Exception($ex->getMessage(), (int)$ex->getCode(), $ex);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
class Exception extends \yii\base\Exception
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use yii\base\Component;
|
||||
use yii\db\MigrationInterface;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use Yii;
|
||||
use ArangoDBClient\Document;
|
||||
@@ -131,13 +131,13 @@ class Query extends Component implements QueryInterface
|
||||
$options = ArrayHelper::merge($params, $options);
|
||||
$statement = $this->getStatement($options);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
return $this->prepareResult($cursor->getAll());
|
||||
@@ -619,13 +619,13 @@ class Query extends Component implements QueryInterface
|
||||
{
|
||||
$statement = $this->createCommand($db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
return $this->prepareResult($cursor->getAll());
|
||||
@@ -641,13 +641,13 @@ class Query extends Component implements QueryInterface
|
||||
$this->limit(1);
|
||||
$statement = $this->createCommand($db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
$result = $this->prepareResult($cursor->getAll());
|
||||
@@ -682,13 +682,13 @@ class Query extends Component implements QueryInterface
|
||||
|
||||
$statement = $this->getStatement($params, $db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::insert');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::insert');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::insert');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::insert');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::insert');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::insert');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::insert');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::insert');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
return true;
|
||||
@@ -725,13 +725,13 @@ class Query extends Component implements QueryInterface
|
||||
|
||||
$statement = $this->getStatement($params, $db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::update');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::update');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::update');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::update');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::update');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::update');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::update');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::update');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
$meta = $cursor->getMetadata();
|
||||
@@ -770,13 +770,13 @@ class Query extends Component implements QueryInterface
|
||||
|
||||
$statement = $this->getStatement($params, $db);
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::remove');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::remove');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::remove');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::remove');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::remove');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::remove');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::remove');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::remove');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
$meta = $cursor->getMetadata();
|
||||
@@ -859,13 +859,13 @@ class Query extends Component implements QueryInterface
|
||||
$statement->setBatchSize(1);
|
||||
|
||||
$token = $this->getRawAql($statement);
|
||||
Yii::info($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::info($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
try {
|
||||
Yii::beginProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::beginProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
$cursor = $statement->execute();
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
} catch (\Exception $ex) {
|
||||
Yii::endProfile($token, 'explosivebit\arangodb\Query::query');
|
||||
Yii::endProfile($token, 'mirzaev\yii2\arangodb\Query::query');
|
||||
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
|
||||
}
|
||||
return $cursor->getFullCount();
|
||||
@@ -1237,6 +1237,6 @@ class Query extends Component implements QueryInterface
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function emulateExecution ( $value = true ){}
|
||||
}
|
||||
|
@@ -1,11 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* User: evgen-d
|
||||
* Date: 08.10.14
|
||||
* Time: 16:04
|
||||
*/
|
||||
|
||||
namespace explosivebit\arangodb;
|
||||
namespace mirzaev\yii2\arangodb;
|
||||
|
||||
use yii\base\Arrayable;
|
||||
|
||||
@@ -56,4 +51,3 @@ class Serializer
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "elfarqy/yii2-arangodb",
|
||||
"description": "Yii2 arangodb components",
|
||||
"type": "yii2-extension",
|
||||
"keywords": ["yii2","arangodb"],
|
||||
"license": "GPL-3.0+",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ilya Rumyantsev",
|
||||
"email": "explosivebit@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Alvian Burhanuddin",
|
||||
"email": "alvianthelfarqy@gmail.com"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"yiisoft/yii2": "*",
|
||||
"triagens/arangodb": "~3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"yiisoft/yii2-debug": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"explosivebit\\arangodb\\": ""
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb\console\controllers;
|
||||
namespace mirzaev\yii2\arangodb\console\controllers;
|
||||
|
||||
use explosivebit\arangodb\Connection;
|
||||
use explosivebit\arangodb\Exception;
|
||||
use explosivebit\arangodb\Migration;
|
||||
use explosivebit\arangodb\Query;
|
||||
use mirzaev\yii2\arangodb\Connection;
|
||||
use mirzaev\yii2\arangodb\Exception;
|
||||
use mirzaev\yii2\arangodb\Migration;
|
||||
use mirzaev\yii2\arangodb\Query;
|
||||
|
||||
use yii;
|
||||
use yii\console\controllers\BaseMigrateController;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb\panels\arangodb;
|
||||
namespace mirzaev\yii2\arangodb\panels\arangodb;
|
||||
|
||||
use explosivebit\arangodb\panels\arangodb\models\ArangoDb;
|
||||
use mirzaev\yii2\arangodb\panels\arangodb\models\ArangoDb;
|
||||
use Yii;
|
||||
use yii\debug\Panel;
|
||||
use yii\log\Logger;
|
||||
@@ -31,11 +31,11 @@ class ArangoDbPanel extends Panel
|
||||
$target->messages,
|
||||
Logger::LEVEL_PROFILE,
|
||||
[
|
||||
'explosivebit\arangodb\Query::query',
|
||||
'explosivebit\arangodb\Query::insert',
|
||||
'explosivebit\arangodb\Query::update',
|
||||
'explosivebit\arangodb\Query::remove',
|
||||
'explosivebit\arangodb\Query::execute',
|
||||
'mirzaev\yii2\arangodb\Query::query',
|
||||
'mirzaev\yii2\arangodb\Query::insert',
|
||||
'mirzaev\yii2\arangodb\Query::update',
|
||||
'mirzaev\yii2\arangodb\Query::remove',
|
||||
'mirzaev\yii2\arangodb\Query::execute',
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -136,15 +136,15 @@ class ArangoDbPanel extends Panel
|
||||
|
||||
protected function getQueryType($category) {
|
||||
switch ($category) {
|
||||
case 'explosivebit\arangodb\Query::query' :
|
||||
case 'mirzaev\yii2\arangodb\Query::query' :
|
||||
return 'SELECT';
|
||||
case 'explosivebit\arangodb\Query::insert' :
|
||||
case 'mirzaev\yii2\arangodb\Query::insert' :
|
||||
return 'INSERT';
|
||||
case 'explosivebit\arangodb\Query::update' :
|
||||
case 'mirzaev\yii2\arangodb\Query::update' :
|
||||
return 'UPDATE';
|
||||
case 'explosivebit\arangodb\Query::remove' :
|
||||
case 'mirzaev\yii2\arangodb\Query::remove' :
|
||||
return 'REMOVE';
|
||||
case 'explosivebit\arangodb\Query::execute' :
|
||||
case 'mirzaev\yii2\arangodb\Query::execute' :
|
||||
return 'EXECUTE';
|
||||
default :
|
||||
return '';
|
||||
@@ -155,4 +155,4 @@ class ArangoDbPanel extends Panel
|
||||
{
|
||||
return ['arango-messages' => $this->getProfileLogs()];
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace explosivebit\arangodb\panels\arangodb\models;
|
||||
namespace mirzaev\yii2\arangodb\panels\arangodb\models;
|
||||
|
||||
use yii;
|
||||
use yii\data\ArrayDataProvider;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
echo "<?php\n";
|
||||
?>
|
||||
|
||||
class <?= $className ?> extends \explosivebit\arangodb\Migration
|
||||
class <?= $className ?> extends \mirzaev\yii2\arangodb\Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
|
Reference in New Issue
Block a user