diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22d0d82 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..daa94e5 --- /dev/null +++ b/composer.json @@ -0,0 +1,49 @@ +{ + "name": "mirzaev/vk-arangodb", + "description": "Module for mirzaev/vk framework for storage data in ArangoDB", + "keywords": [ + "ArangoDB", + "vk", + "module" + ], + "type": "vk-module", + "license": "WTFPL", + "homepage": "https://git.mirzaev.sexy/mirzaev/vk-arangodb", + "authors": [ + { + "name": "Arsen Mirzaev Tatyano-Muradovich", + "email": "arsen@mirzaev.sexy", + "homepage": "https://mirzaev.sexy", + "role": "Programmer" + } + ], + "support": { + "email": "arsen@mirzaev.sexy", + "wiki": "https://git.mirzaev.sexy/mirzaev/vk-arangodb/wiki", + "issues": "https://git.mirzaev.sexy/mirzaev/vk-arangodb/issues" + }, + "funding": [ + { + "type": "funding", + "url": "https://fund.mirzaev.sexy" + } + ], + "require": { + "php": "^8.1", + "mirzaev/vk": "~4.0.1", + "mirzaev/accounts": "1.2.x-dev", + "mirzaev/arangodb": "^1.0.0", + "triagens/arangodb": "~3.9.x-dev", + "guzzlehttp/guzzle": "~7.5" + }, + "autoload": { + "psr-4": { + "mirzaev\\vk\\arangodb\\": "mirzaev/vk/arangodb/system" + } + }, + "autoload-dev": { + "psr-4": { + "mirzaev\\vk\\arangodb\\tests\\": "mirzaev/vk/arangodb/tests" + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..ca82fa7 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1013 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "439d40833ea94e08c6dda41b6bd9e8f0", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.9 || ^2.4", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "7.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-08-28T15:39:27+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "b94b2807d85443f9719887892882d0329d1e2598" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2022-08-28T14:55:35+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "3148458748274be1546f8f2809a6c09fe66f44aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/3148458748274be1546f8f2809a6c09fe66f44aa", + "reference": "3148458748274be1546f8f2809a6c09fe66f44aa", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.4.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-10-25T13:49:28+00:00" + }, + { + "name": "jasny/error-handler", + "version": "v0.2.0", + "source": { + "type": "git", + "url": "https://github.com/jasny/error-handler.git", + "reference": "38e076fc36d86689010081bc2eab96f12d97b0d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jasny/error-handler/zipball/38e076fc36d86689010081bc2eab96f12d97b0d8", + "reference": "38e076fc36d86689010081bc2eab96f12d97b0d8", + "shasum": "" + }, + "require": { + "php": ">=5.6.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0" + }, + "require-dev": { + "jasny/http-message": "^1.3", + "jasny/php-code-quality": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jasny\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arnold Daniels", + "email": "arnold@jasny.net", + "homepage": "http://www.jasny.net" + } + ], + "description": "Error handler with PSR-7 support", + "keywords": [ + "error handler", + "exception handler", + "middleware" + ], + "support": { + "issues": "https://github.com/jasny/error-handler/issues", + "source": "https://github.com/jasny/error-handler" + }, + "abandoned": true, + "time": "2017-01-25T01:27:18+00:00" + }, + { + "name": "mirzaev/accounts", + "version": "1.2.x-dev", + "source": { + "type": "git", + "url": "https://git.hood.su/mirzaev/accounts", + "reference": "4b0a1a1c34128c281b83485cde53d97df6c82a49" + }, + "require": { + "ext-dom": "20031129", + "ext-libxml": "~8.0", + "guzzlehttp/guzzle": "~7.2", + "php": "~8.0" + }, + "require-dev": { + "phpdocumentor/phpdocumentor": ">=2.9", + "phpunit/phpunit": "^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "mirzaev\\accounts\\": "mirzaev/accounts/system" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Arsen Mirzaev", + "email": "red@hood.su", + "homepage": "https://hood.su/sex", + "role": "Programmer" + } + ], + "description": "Менеджер аккаунтов", + "homepage": "https://git.hood.su/mirzaev/accounts", + "keywords": [ + "accounts" + ], + "support": { + "chat": "https://vk.me/darkweb228", + "docs": "https://git.hood.su/mirzaev/accounts/manual", + "issues": "https://git.hood.su/mirzaev/accounts/issues" + }, + "time": "2021-07-31T11:12:52+00:00" + }, + { + "name": "mirzaev/arangodb", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.hood.su/mirzaev/arangodb", + "reference": "0012a31e6bea1050385f6b740581f32b9e366128" + }, + "require": { + "php": "^8.1", + "triagens/arangodb": "~3.8" + }, + "require-dev": { + "phpunit/phpunit": "^9.3.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "mirzaev\\arangodb\\": "mirzaev/arangodb/system" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Arsen Mirzaev Tatyano-Muradovich", + "email": "arsen@mirzaev.sexy", + "homepage": "https://mirzaev.sexy", + "role": "Developer" + } + ], + "description": "Реализация управления хранилищем данных ArangoDB", + "homepage": "https://git.hood.su/mirzaev/arangodb", + "keywords": [ + "ArangoDb" + ], + "time": "2022-10-25T20:16:30+00:00" + }, + { + "name": "mirzaev/vk", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://git.hood.su/mirzaev/vk", + "reference": "850a4bbd8ef6ba232c0e810eba5f118345a862fa" + }, + "require": { + "guzzlehttp/guzzle": "~7.5", + "jasny/error-handler": "~0.2", + "mirzaev/accounts": "~1.2.x-dev", + "monolog/monolog": "~1.6", + "php": "~8.1", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~9.5" + }, + "type": "framework", + "autoload": { + "psr-4": { + "mirzaev\\vk\\": "mirzaev/vk/system" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Arsen Mirzaev Tatyano-Muradovich", + "email": "arsen@mirzaev.sexy", + "homepage": "https://hood.su/mirzaev", + "role": "Programmer" + } + ], + "description": "Фреймворк VK API", + "homepage": "https://git.hood.su/mirzaev/vk", + "keywords": [ + "api", + "vk" + ], + "support": { + "docs": "https://git.hood.su/mirzaev/vk/manual", + "issues": "https://git.hood.su/mirzaev/vk/issues" + }, + "time": "2022-10-23T17:22:42+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "~4.5", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.27.1" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-06-09T08:53:42+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-25T11:15:52+00:00" + }, + { + "name": "triagens/arangodb", + "version": "3.9.x-dev", + "source": { + "type": "git", + "url": "https://github.com/arangodb/arangodb-php.git", + "reference": "de14fbcf8390e3ae1e706c52695386218eeba151" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/arangodb/arangodb-php/zipball/de14fbcf8390e3ae1e706c52695386218eeba151", + "reference": "de14fbcf8390e3ae1e706c52695386218eeba151", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "ArangoDBClient": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Jan Steemann", + "homepage": "https://github.com/arangodb/arangodb-php", + "role": "Developer" + }, + { + "name": "Frank Mayer", + "homepage": "https://github.com/arangodb/arangodb-php", + "role": "Developer" + }, + { + "name": "Contributors", + "homepage": "https://github.com/arangodb/arangodb-php/graphs/contributors" + } + ], + "description": "ArangoDB PHP client", + "homepage": "https://github.com/arangodb/arangodb-php", + "keywords": [ + "Arango", + "ArangoDb", + "database", + "distributed", + "document store", + "graph database", + "multi-model", + "nosql" + ], + "support": { + "issues": "https://github.com/arangodb/arangodb-php/issues", + "source": "https://github.com/arangodb/arangodb-php/tree/3.9" + }, + "time": "2022-02-03T09:42:22+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "mirzaev/accounts": 20, + "triagens/arangodb": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^8.1" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/mirzaev/vk/arangodb/system/.gitignore b/mirzaev/vk/arangodb/system/.gitignore new file mode 100644 index 0000000..46f7cc2 --- /dev/null +++ b/mirzaev/vk/arangodb/system/.gitignore @@ -0,0 +1 @@ +storage/* diff --git a/mirzaev/vk/arangodb/system/journal.php b/mirzaev/vk/arangodb/system/journal.php new file mode 100644 index 0000000..6062d13 --- /dev/null +++ b/mirzaev/vk/arangodb/system/journal.php @@ -0,0 +1,167 @@ + [], + 'expires' => strtotime('first day of next month 00:00') + ]))) { + // Не удалось создать документ + + return null; + } + + if (empty(document::write($session, longpoll::COLLECTION_ACCESSED, ['_from' => $document, '_to' => $journal]))) { + // Не удалось создать ребро: {$document} -> ЖУРНАЛ + + return null; + } + } + + // Инициализация инстанции журнала и возврат + return new static($session, $journal); + } + + /** + * Поиск журнала + * + * Находит актуальный документ журнала + * + * @param _connection $session Сессия соединения с базой данных + * @param string $document Идентификатор документа + * + * @return _document|null Инстанция (static::COLLECTION_JOURNAL) или его идентификатор + */ + public static function search(_connection $session, string $document): _document|null + { + // Инициализация ярлыка названия коллекции + $collection = static::COLLECTION_JOURNAL; + + // Инициализация ярлыка названия ребра + $edge = longpoll::COLLECTION_ACCESSED; + + // Инициализация даты для разделения по журналам + $time = time(); + + // Поиск журнала + $journal = (new _statement( + $session, + [ + 'query' => <<= $time + LIMIT 1 + RETURN a + AQL, + "batchSize" => 1000, + "sanitize" => true + ] + ))->execute(); + + // Инициализация буфера вывода + $buffer = []; + + foreach ($journal as $key => $value) { + // Перебор параметров для универсализации вывода + + // Запись в буфер + $buffer[$key] = $value; + } + + // Возврат (подразумевается, что в буфере только 1 значение - инстанция (static::COLLECTION_JOURNAL)) + return $buffer[0] ?? null; + } + + /** + * Запись в журнал + * + * @param string $event Событие + * @param array $data Дополнительная информация + * + * @return bool Статус обработки + */ + public function write(string $event, array $data = []): bool + { + // Запись в инстанцию документа + $this->document->events += [ + [ + 'date' => time(), + 'event' => $event, + 'data' => $data + ] + ]; + + // Запись в базу данных + return document::update($this->session, $this->document); + } +} diff --git a/mirzaev/vk/arangodb/system/longpoll.php b/mirzaev/vk/arangodb/system/longpoll.php new file mode 100644 index 0000000..3af9d58 --- /dev/null +++ b/mirzaev/vk/arangodb/system/longpoll.php @@ -0,0 +1,430 @@ +{$update['type']}($update['object'], $update['group_id'], $update['event_id'])) { + // Удалось сохранить в базу данных + + return true; + } + } catch (Exception $e) { + terminal::write($e->getMessage() . PHP_EOL . $e->getFile() . ':' . $e->getLine()); + } + + return false; + } + + /** + * Событие: "message_new" + * + * Новое сообщение + * + * @param array $data Данные сообщения + * @param int $group Идентификатор группы + * @param string $event Идентификатор события + * + * @return bool + */ + public function message_new(array $data, int $group, string $event): bool + { + if ($this->connection->create) { + // Запрошено создание коллекций в случае их отсутствия + + collection::init($this->connection->session, static::COLLECTION_USERS); + collection::init($this->connection->session, static::COLLECTION_MESSAGES); + } + + if ($message = document::write($this->connection->session, static::COLLECTION_MESSAGES, static::messages($data, true))) { + // Записано сообщение + + // Инициализация коллекции + $collection = static::COLLECTION_MESSAGES; + + // Инициализация аккаунтов + $from = ('mirzaev\\vk\\arangodb\\vk\\' . static::type($data['message']['from_id']))::init($this->connection->session, $data['message']['from_id']); + $to = ('mirzaev\\vk\\arangodb\\vk\\' . static::type($data['message']['peer_id']))::init($this->connection->session, $data['message']['peer_id']); + + if ($from instanceof _document && $to instanceof _document) { + // Инициализированы аккаунты + + if ($this->connection->create) { + // Запрошено создание коллекций в случае их отсутствия + + collection::init($this->connection->session, static::COLLECTION_ACCESSED, edge: true); + } + + if (document::write($this->connection->session, static::COLLECTION_ACCESSED, [], ['_from' => $from->getId(), '_to' => $message])) { + // Записано ребро: АККАУНТ (отправитель) -> СООБЩЕНИЕ + } + + if (document::write($this->connection->session, static::COLLECTION_ACCESSED, [], ['_from' => $message, '_to' => $to->getId()])) { + // Записно ребро: СООБЩЕНИЕ -> АККАУНТ (получатель) + } + } + + // Журналирование + if ($this->journal && journal::init($this->connection->session, $message)->write('create', [ + 'account' => $from, + 'changes' => [ + 'new' => collection::search($this->connection->session, << null + ] + ])) { + // Записано ребро: СООБЩЕНИЕ -> СООБЩЕНИЕ + } + + return true; + } + + + throw new Exception('Не удалось сохранить сообщение в базу даннных', 500); + } + + /** + * Обработка сообщений + * + * @param array $messages Сообщения или сообщение + * @param bool $download Активация скачивания файлов на сервер + * @param bool $clean Активация очистки массива от пустых данных сообщения + * + * @return array Обработанные сообщения (зависит от входных данных) + * + * @todo + * 1. Переделать $message['vk']['metadata']['action']['cover'] + * 2. Переделать $message['vk']['metadata']['payload'] + * 3. Узнать про Notify API и добавить message_tag + * 4. В будущем удалить $message['message']['body'] + * 5. Переделать $message['vk']['metadata']['conversation']['members']['amount_test'] (или удалить) + * 6. Разобраться с "Мультидиалогом" для старых версий API и существует ли он в новых + */ + public static function messages(array $messages, bool $download = false, bool $clean = true): array + { + if (isset($messages['message'])) { + // Передано одно сообщение + + // Инициализация + $buffer[] = &$messages; + } + + foreach ($buffer ?? $messages as &$message) { + // Перебор сообщений + + $message = [ + 'data' => [ + 'id' => [ + 'global' => $message['message']['id'], + 'local' => $message['message']['conversation_message_id'] + ], + 'text' => $message['message']['text'] ?? $message['message']['body'], + 'forward' => static::messages($message['message']['fwd_messages']), + 'reply' => static::messages($message['message']['fwd_messages']), + 'attachments' => static::attachments($message['message']['attachments'], $download, $clean) + ], + 'metadata' => [ + 'date' => [ + 'create' => $message['message']['date'] ?? null, + 'update' => $message['message']['update_time'] ?? null + ], + 'action' => [ + 'type' => $message['message']['action'] ?? null, + 'target' => [ + 'id' => $message['message']['action']['member_id'] ?? null + ], + 'text' => $message['message']['action']['text'] ?? null, + 'email ' => $message['message']['action']['email'] ?? null, + 'cover ' => $message['message']['action']['photo'] ?? null + ], + 'hash' => $message['message']['random_id'] ?? null, + 'type' => $message['message']['out'] ?? null, + 'admin' => [ + 'id' => $message['message']['admin_author_id'] ?? null + ], + 'pinned' => [ + 'date' => $message['message']['pinned_at'] ?? null + ], + 'emoji' => $message['message']['emoji'] ?? null, + 'readed' => $message['message']['read_state'] ?? null, + 'listened' => $message['message']['was_listened'] ?? null, + 'hidden' => $message['message']['is_hidden'] ?? null, + 'cropped' => $message['message']['is_cropped'] ?? null, + 'deleted' => $message['message']['deleted'] ?? null, + 'conversation' => + [ + 'id' => $message['message']['chat_id'] ?? null, + 'admin' => [ + 'id' => $message['message']['admin_id'] ?? null + ], + 'title' => $message['message']['title'] ?? null, + 'members' => [ + 'amount' => $message['message']['members_count'] ?? null, + 'amount_test' => $message['message']['users_count'] ?? null + ], + 'active' => $message['message']['chat_active'] ?? null, + 'settings' => [ + 'push' => $message['message']['push_settings'] ?? null + ] + ], + 'important' => $message['message']['important'] ?? null, + 'source' => [ + 'from' => $message['message']['ref'] ?? null, + 'data' => $message['message']['ref_source'] ?? null + ], + 'payload' => $message['message']['payload'] ?? null, + 'geo' => [ + $message['message']['geo'] ?? null + ], + 'keyboard' => [ + 'block' => $message['client_info']['keyboard'] ?? null, + 'inline' => $message['client_info']['inline_keyboard'] ?? null, + 'buttons' => $message['client_info']['button_actions'] ?? null, + ], + 'carousel' => $message['client_info']['carousel'] ?? null, + 'language' => $message['client_info']['lang_id'] ?? null, + ] + ]; + } + + // Очистка массива, если активировано + $clean and static::cleaner($messages); + + return $messages; + } + + /** + * Обработка вложений + * + * @param array $attachments Вложения + * @param bool $download Активация скачивания файлов на сервер + * @param bool $clean Активация очистки массива от пустых данных сообщения + * + * @return array Обработанные вложения + */ + public static function attachments(array $attachments, bool $download = false, bool $clean = false): array + { + foreach ($attachments as &$attachment) { + // Перебор вложений + + if ($attachment['type'] === 'photo') { + // Изображение + + $attachment = [ + 'data' => [ + 'date' => $attachment['photo']['date'] ?? null, + 'id' => $attachment['photo']['id'] ?? null, + 'album' => [ + 'id' => $attachment['photo']['album_id'] ?? null + ], + 'account' => [ + 'id' => $attachment['photo']['user_id'] ?? null, + 'admin' => $attachment['photo']['owner_id'] ?? null + ], + 'tags' => $attachment['photo']['has_tags'] ?? null, + 'access' => [ + 'key' => $attachment['photo']['access_key'] ?? null + ], + 'text' => $attachment['photo']['text'] ?? null, + 'storage' => static::sizes($attachment['photo']['sizes'], $download) ?? null + ], + 'metadata' => [ + 'type' => $attachment['type'] ?? null + ] + ]; + } + } + + // Очистка массива, если активировано + $clean and static::cleaner($attachments); + + return $attachments; + } + + /** + * Сортировка размеров файла из вложения + * + * @param array $sizes Размеры файла согласно спецификации в API + * @param bool $download Активация скачивания файлов на сервер + * @param int|null $id Идентификатор аккаунта кому принадлежат изображения + * + * @return array Обработанные размеры + * + * @see https://vk.com/dev/photo_sizes + */ + public static function sizes(array $sizes, bool $download = false, int|null $id = null): array + { + foreach ($sizes as &$size) { + // Перебор размеров + + if ($download) { + // Запрошено сохранение на сервер + + // Инициализация + $browser = new Guzzle(); + + // Инициализация директории + if (!file_exists($path = static::$path_storage . (isset($id) ? static::$path_storage_accounts . PHP_EOL . $id : static::$path_storage_vk) . static::$path_storage_accounts_images . PHP_EOL . date('Y_m_d', time()))) + if (!mkdir($path, 0755, true)) + throw new Exception('Не удалось инициализировать директорию: ' . $path); + + // Генерация временного файла с уникальным дескриптором + $file = tempnam($path, ''); + + // Сохранение в файл + $request = $browser->get($size['url'], ['sink' => $file]); + + var_dump($request->getHeaders()); + die; + + // Чтение расширения файла + $ext = $request->getHeader('Mime-Type'); + + // Перезапись + rename($file, dirname($file) . PHP_EOL . (static::disposition_filename($request->getHeader('Content-Disposition')[0]) ?? 1)); + } + + // Инициализация + $size = [ + 'data' => [ + 'width' => [ + 'value' => $size['width'], + 'unit' => 'px' + ], + 'height' => [ + 'value' => $size['height'], + 'unit' => 'px' + ], + 'source' => [ + 'vk' => $size['url'] + ] + ], + 'metadata' => [ + 'type' => $size['type'] + ] + ]; + } + + return $sizes; + } + + + // Инициализация + public static function cleaner(array &$target): bool + { + // Инициализация + $changes = false; + + foreach ($target as $key => &$value) { + // Перебор элементов массива + + if ($value === null || $value === []) { + // Пустое значение + + // Удаление из массива по ключу + unset($target[$key]); + + // Запись обозначения о том, что были произведены изменения + $changes = true; + } else if (is_array($value)) { + // Элемент является массивом + + // Начало рекурсии (повторяется до тех пор пока производятся изменения за итерацию) + while (static::cleaner($value)); + } + } + + return $changes; + } + + public function truncate() + { + collection::truncate($this->connection->session, static::COLLECTION_USERS); + collection::truncate($this->connection->session, static::COLLECTION_GROUPS); + collection::truncate($this->connection->session, static::COLLECTION_CHATS); + collection::truncate($this->connection->session, static::COLLECTION_MESSAGES); + collection::truncate($this->connection->session, static::COLLECTION_ACCESSED); + collection::truncate($this->connection->session, journal::COLLECTION_JOURNAL); + } + + /** + * Определить тип аккаунта + * + * @param int $id Идентификатор + * + * @return string Возвращает 'user', если не прошли другие проверки + */ + public static function type(int $id): string + { + // Чат + if ($id - 2000000000 >= 0) return static::COLLECTION_CHATS; + + // Группа + if (((string) $id)[0] === '-') return static::COLLECTION_GROUPS; + + return static::COLLECTION_USERS; + } +} diff --git a/mirzaev/vk/arangodb/system/terminal.php b/mirzaev/vk/arangodb/system/terminal.php new file mode 100644 index 0000000..21b4b75 --- /dev/null +++ b/mirzaev/vk/arangodb/system/terminal.php @@ -0,0 +1,20 @@ + true, 'filename' => false]; + $targets = []; + + foreach ($masks as $mask => $utf8) { + // Перебор значений масок + + if (isset($params[$mask])) { + // Параметр из буфера прошел проверку по маске + + // Инициализация + $target = trim($params[$mask]); + + // Надо разобраться с этим + if ($utf8 && strpos($target, "utf-8''") === 0 && $target = substr($target, strlen("utf-8''"))) + $target = rawurldecode($target); + + // Надо разобраться с этим + if (substr($target, 0, 1) === '"' && substr($target, -1, 1) === '"') + $target = substr($target, 1, -1); + + $targets[$mask] = $target; + } + } + + // Возврат по приоритету + return $targets[$masks[0]] ?? $targets[$masks[1]]; + } + + return null; + } +} diff --git a/mirzaev/vk/arangodb/system/traits/HTTP/headers/content/type.php b/mirzaev/vk/arangodb/system/traits/HTTP/headers/content/type.php new file mode 100644 index 0000000..a87492f --- /dev/null +++ b/mirzaev/vk/arangodb/system/traits/HTTP/headers/content/type.php @@ -0,0 +1,14 @@ + ['id' => $id]])) { + // Аккаунт записан + + // Журналирование + if ($journal && journal::init($session, $account)->write('create', [ + 'changes' => [ + 'new' => collection::search($session, << null + ] + ])) { + // Записаны данные в журнал + } + + if ($account = collection::search($session, << ['id' => $id]])) { + // Аккаунт записан + + // Журналирование + if ($journal && journal::init($session, $account)->write('create', [ + 'changes' => [ + 'new' => collection::search($session, << null + ] + ])) { + // Записаны данные в журнал + } + + if ($account = collection::search($session, << $id])) { + // Аккаунт записан + + // Журналирование + if ($journal && journal::init($session, $account)->write('create', [ + 'changes' => [ + 'new' => collection::search($session, << null + ] + ])) { + // Записаны данные в журнал + } + + if ($account = collection::search($session, <<