diff --git a/composer.json b/composer.json index 22d3dc9..9fb2940 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,19 @@ { + "type": "library", "name": "devimteam/rabbitmq-service-provider", "description": "Silex rabbitmq service provider", - "type": "library", + "keywords": [], + "license": "", + "authors": [], + "version": "1.0.2", "minimum-stability": "dev", - "prefer-stable": true, "require": { "php": ">=7.1", "pimple/pimple": "^3.0", "php-amqplib/rabbitmq-bundle": "~1.14", + "knplabs/console-service-provider": "~1.0", + "vlobchuk/isolate-console-provider": "dev-master", + "silex/silex": "~2.0.3-DEV", "ext-amqp": "*" }, "require-dev": { @@ -15,7 +21,7 @@ }, "autoload": { "psr-4": { - "Devim\\": "src/" + "Devim\\Provider\\RabbitmqServiceProvider\\": "src/" } } } diff --git a/composer.lock b/composer.lock index 9317705..68471a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,95 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "931cc660b311be5fb2a5fe16350ee1b4", + "content-hash": "a0d75fb8d8d09fb05467b9b2b3b89c80", "packages": [ + { + "name": "knplabs/console-service-provider", + "version": "1.1", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/ConsoleServiceProvider.git", + "reference": "7a839206270755483f6a06a6cfb3308fa6f9c562" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/ConsoleServiceProvider/zipball/7a839206270755483f6a06a6cfb3308fa6f9c562", + "reference": "7a839206270755483f6a06a6cfb3308fa6f9c562", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3|~3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Knp\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Knplabs", + "homepage": "http://knplabs.com" + } + ], + "description": "console service provider for Silex", + "homepage": "http://knplabs.com", + "keywords": [ + "console", + "silex" + ], + "time": "2016-02-01T15:38:27+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, { "name": "pimple/pimple", "version": "v3.2.3", @@ -104,6 +191,756 @@ "psr" ], "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "silex/silex", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Silex.git", + "reference": "49ca08d853731d1635374e5019c8696cfd53c161" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Silex/zipball/49ca08d853731d1635374e5019c8696cfd53c161", + "reference": "49ca08d853731d1635374e5019c8696cfd53c161", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "pimple/pimple": "~3.0", + "symfony/event-dispatcher": "~2.8|^3.0", + "symfony/http-foundation": "~2.8|^3.0", + "symfony/http-kernel": "~2.8|^3.0", + "symfony/routing": "~2.8|^3.0" + }, + "replace": { + "silex/api": "self.version", + "silex/providers": "self.version" + }, + "require-dev": { + "doctrine/dbal": "~2.2", + "monolog/monolog": "^1.4.1", + "swiftmailer/swiftmailer": "~5", + "symfony/asset": "~2.8|^3.0", + "symfony/browser-kit": "~2.8|^3.0", + "symfony/config": "~2.8|^3.0", + "symfony/css-selector": "~2.8|^3.0", + "symfony/debug": "~2.8|^3.0", + "symfony/doctrine-bridge": "~2.8|^3.0", + "symfony/dom-crawler": "~2.8|^3.0", + "symfony/expression-language": "~2.8|^3.0", + "symfony/finder": "~2.8|^3.0", + "symfony/form": "~2.8|^3.0", + "symfony/intl": "~2.8|^3.0", + "symfony/monolog-bridge": "~2.8|^3.0", + "symfony/options-resolver": "~2.8|^3.0", + "symfony/phpunit-bridge": "~2.8|^3.0", + "symfony/process": "~2.8|^3.0", + "symfony/security": "~2.8|^3.0", + "symfony/serializer": "~2.8|^3.0", + "symfony/translation": "~2.8|^3.0", + "symfony/twig-bridge": "~2.8|^3.0", + "symfony/validator": "~2.8|^3.0", + "symfony/var-dumper": "~2.8|^3.0", + "twig/twig": "~1.27|~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Silex\\": "src/Silex" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "The PHP micro-framework based on the Symfony Components", + "homepage": "http://silex.sensiolabs.org", + "keywords": [ + "microframework" + ], + "abandoned": "symfony/flex", + "time": "2016-11-06T18:09:06+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "19090917b848a799cbae4800abf740fe4eb71c1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/19090917b848a799cbae4800abf740fe4eb71c1d", + "reference": "19090917b848a799cbae4800abf740fe4eb71c1d", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:09:42+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T08:57:11+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb", + "reference": "4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.10|<4.0.10,>=4", + "symfony/var-dumper": "<3.3", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.10|^4.0.10", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2018-11-03T10:03:02+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "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": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T06:26:08+00:00" + }, + { + "name": "symfony/routing", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "585f6e2d740393d546978769dd56e496a6233e0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/585f6e2d740393d546978769dd56e496a6233e0b", + "reference": "585f6e2d740393d546978769dd56e496a6233e0b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "vlobchuk/isolate-console-provider", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/l-vitaly/isolate-console-provider.git", + "reference": "ea072aacf6e99c915b5cb2e9668294de7f13aca6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/l-vitaly/isolate-console-provider/zipball/ea072aacf6e99c915b5cb2e9668294de7f13aca6", + "reference": "ea072aacf6e99c915b5cb2e9668294de7f13aca6", + "shasum": "" + }, + "require": { + "pimple/pimple": ">=2.1,<4", + "symfony/console": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Isolate\\ConsoleServiceProvider\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Vitaly Lobchuk", + "email": "vn.lobchuk@gmail.com" + } + ], + "time": "2016-04-12T08:09:03+00:00" } ], "packages-dev": [ @@ -780,16 +1617,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c151651fb6ed264038d486ea262e243af72e5e64" + "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64", - "reference": "c151651fb6ed264038d486ea262e243af72e5e64", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b1be2c8530c4c29c3519a052c9fb6cee55053bbd", + "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd", "shasum": "" }, "require": { @@ -860,7 +1697,7 @@ "testing", "xunit" ], - "time": "2018-10-23T05:57:41+00:00" + "time": "2018-11-14T16:52:02+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1518,11 +2355,14 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "vlobchuk/isolate-console-provider": 20, + "silex/silex": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0.7" + "php": ">=7.1" }, "platform-dev": [] } diff --git a/src/ConsumerManager.php b/src/ConsumerManager.php new file mode 100644 index 0000000..4009d9c --- /dev/null +++ b/src/ConsumerManager.php @@ -0,0 +1,60 @@ +setName('rabbitmq:consumer') + ->addArgument('name', InputArgument::REQUIRED, 'Consumer Name') + ->addOption('messages', 'm', InputOption::VALUE_OPTIONAL, 'Messages to consume', 0) + ->addOption('route', 'r', InputOption::VALUE_OPTIONAL, 'Routing Key', '') + ->addOption('memory-limit', 'l', InputOption::VALUE_OPTIONAL, 'Allowed memory for this process', null) + ->addOption('debug', 'd', InputOption::VALUE_NONE, 'Enable Debugging') + ; + } + /** + * Executes the current command. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return integer 0 if everything went fine, or an error code + * + * @throws \InvalidArgumentException When the number of messages to consume is less than 0 + * @throws \BadFunctionCallException When the pcntl is not installed and option -s is true + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if (defined('AMQP_DEBUG') === false) { + define('AMQP_DEBUG', (bool) $input->getOption('debug')); + } + $this->amount = $input->getOption('messages'); + if (0 > $this->amount) { + throw new \InvalidArgumentException("The -m option should be null or greater than 0"); + } + $this->consumer = $this->getConsumerInstance($input); + if (!is_null($input->getOption('memory-limit')) && ctype_digit((string)$input->getOption('memory-limit')) && $input->getOption('memory-limit') > 0) { + $this->consumer->setMemoryLimit($input->getOption('memory-limit')); + } + $this->consumer->setRoutingKey($input->getOption('route')); + $this->consumer->consume($this->amount); + } + + protected function getConsumerInstance(InputInterface $input) + { + $app = $this->getContainer(); + + return $app['rabbit.consumer'][$input->getArgument('name')]; + } +} \ No newline at end of file diff --git a/src/ProducerManager.php b/src/ProducerManager.php new file mode 100644 index 0000000..13a4b5f --- /dev/null +++ b/src/ProducerManager.php @@ -0,0 +1,81 @@ +container = $container; + } + + /** + * @param string $name + * + * @return Producer + * @throws InvalidArgumentException + */ + public function getInstance(string $name): Producer + { + if (array_key_exists($name, $this->producers)) { + return $this->producers[$name]; + } + return $this->producers[$name] = $this->getProducer($name); + } + + /** + * @param string $name + * + * @return Producer + * @throws InvalidArgumentException + */ + private function getProducer(string $name): Producer + { + if (!array_key_exists($name, $this->container['rabbit.producers.config'])) { + throw new InvalidArgumentException('Configuration for producer [' . $name . '] not found'); + } + $options = $this->container['rabbit.producers.config'][$name]; + + $nameConnection = $options['connection'] ?? RabbitServiceProvider::DEFAULT_CONNECTION; + if (!isset($this->container['rabbit.connections'][$nameConnection])) { + throw new InvalidArgumentException('Configuration for connection [' . $nameConnection . '] not found'); + } + + $connection = $this->container['rabbit.connection'][$nameConnection]; + $producer = new Producer($connection); + $producer->setExchangeOptions($options['exchange_options']); + //this producer doesn't define a queue + if (!isset($options['queue_options'])) { + $options['queue_options']['name'] = null; + } + $producer->setQueueOptions($options['queue_options']); + if ((array_key_exists('auto_setup_fabric', $options)) && (!$options['auto_setup_fabric'])) { + $producer->disableAutoSetupFabric(); + } + return $producer; + } +} diff --git a/src/Provider/RabbitServiceProvider.php b/src/RabbitServiceProvider.php similarity index 68% rename from src/Provider/RabbitServiceProvider.php rename to src/RabbitServiceProvider.php index f23fb0d..c6f6071 100644 --- a/src/Provider/RabbitServiceProvider.php +++ b/src/RabbitServiceProvider.php @@ -1,16 +1,15 @@ $options) { - $nameConnection = $options['connection'] ?? self::DEFAULT_CONNECTION; - if (!isset($app['rabbit.connection'][$nameConnection])) { - throw new \InvalidArgumentException('Configuration for connection [' . $nameConnection . '] not found'); - } - - $connection = $app['rabbit.connection'][$nameConnection]; - $producer = new Producer($connection); - $producer->setExchangeOptions($options['exchange_options']); - //this producer doesn't define a queue - if (!isset($options['queue_options'])) { - $options['queue_options']['name'] = null; - } - $producer->setQueueOptions($options['queue_options']); - if ((array_key_exists('auto_setup_fabric', $options)) && (!$options['auto_setup_fabric'])) { - $producer->disableAutoSetupFabric(); - } - $producers[$name] = $producer; - } - - return $producers; + return new ProducerManager($app); }; } private function loadConsumers(Container $app) { $app['rabbit.consumer'] = function ($app) { - if (!isset($app['rabbit.consumers'])) { + if (!isset($app['rabbit.consumers.config'])) { return null; } $consumers = []; - foreach ($app['rabbit.consumers'] as $name => $options) { + foreach ($app['rabbit.consumers.config'] as $name => $options) { $nameConnection = $options['connection'] ?? self::DEFAULT_CONNECTION; if (!isset($app['rabbit.connection'][$nameConnection])) { throw new \InvalidArgumentException('Configuration for connection [' . $nameConnection . '] not found'); @@ -114,4 +89,4 @@ private function loadConsumers(Container $app) return $consumers; }; } -} \ No newline at end of file +}