From 4e6b041cca64091b4689c7ff00122785d6092484 Mon Sep 17 00:00:00 2001 From: Matthias Noback Date: Wed, 11 Mar 2015 22:00:47 +0100 Subject: [PATCH] Initial commit, work in progress :) --- .gitignore | 1 + LICENSE | 19 + composer.json | 27 + composer.lock | 2212 +++++++++++++++++ .../Compiler/RegisterCleanersPass.php | 26 + .../DependencyInjection/Configuration.php | 43 + .../LongRunningExtension.php | 75 + .../LongRunningBundle/LongRunningBundle.php | 21 + .../Resources/doctrine_dbal.yml | 8 + .../Resources/doctrine_orm.yml | 16 + .../LongRunningBundle/Resources/services.yml | 6 + .../Resources/simple_bus_rabbit_mq.yml | 7 + src/Core/Cleaner.php | 8 + src/Core/DelegatingCleaner.php | 23 + .../DoctrineDBALPlugin/CloseConnections.php | 31 + .../DoctrineORMPlugin/ClearEntityManagers.php | 26 + .../ResetClosedEntityManagers.php | 33 + .../WhenMessageConsumedOrFailedCleanUp.php | 33 + 18 files changed, 2615 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 src/Bundle/LongRunningBundle/DependencyInjection/Compiler/RegisterCleanersPass.php create mode 100644 src/Bundle/LongRunningBundle/DependencyInjection/Configuration.php create mode 100644 src/Bundle/LongRunningBundle/DependencyInjection/LongRunningExtension.php create mode 100644 src/Bundle/LongRunningBundle/LongRunningBundle.php create mode 100644 src/Bundle/LongRunningBundle/Resources/doctrine_dbal.yml create mode 100644 src/Bundle/LongRunningBundle/Resources/doctrine_orm.yml create mode 100644 src/Bundle/LongRunningBundle/Resources/services.yml create mode 100644 src/Bundle/LongRunningBundle/Resources/simple_bus_rabbit_mq.yml create mode 100644 src/Core/Cleaner.php create mode 100644 src/Core/DelegatingCleaner.php create mode 100644 src/Plugin/DoctrineDBALPlugin/CloseConnections.php create mode 100644 src/Plugin/DoctrineORMPlugin/ClearEntityManagers.php create mode 100644 src/Plugin/DoctrineORMPlugin/ResetClosedEntityManagers.php create mode 100644 src/Plugin/SimpleBusRabbitMQPlugin/WhenMessageConsumedOrFailedCleanUp.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..521d46d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Matthias Noback + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f3c602b --- /dev/null +++ b/composer.json @@ -0,0 +1,27 @@ +{ + "name": "long-running/long-running", + "type": "library", + "description": "Tools for working with long-running processes", + "homepage": "http://github.com/LongRunning/LongRunning", + "license": "MIT", + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "require": { + "php": ">=5.4" + }, + "require-dev": { + "doctrine/orm": "~2.3", + "simple-bus/rabbitmq-bundle": "dev-master", + "symfony/framework-bundle": "~2.3" + }, + "autoload": { + "psr-4" : { "LongRunning\\" : "src/" } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..5a8e38f --- /dev/null +++ b/composer.lock @@ -0,0 +1,2212 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "cfeef0e5b7e242bc6f082d8346ad5bc4", + "packages": [], + "packages-dev": [ + { + "name": "beberlei/assert", + "version": "v2.3", + "source": { + "type": "git", + "url": "https://github.com/beberlei/assert.git", + "reference": "160eba4d1fbe692e42b3cf8a20b92ab23e3a8759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/assert/zipball/160eba4d1fbe692e42b3cf8a20b92ab23e3a8759", + "reference": "160eba4d1fbe692e42b3cf8a20b92ab23e3a8759", + "shasum": "" + }, + "require": { + "ext-mbstring": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Assert": "lib/" + }, + "files": [ + "lib/Assert/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + } + ], + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], + "time": "2014-12-18 19:12:40" + }, + { + "name": "doctrine/annotations", + "version": "v1.2.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "eeda578cbe24a170331a1cfdf78be723412df7a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/eeda578cbe24a170331a1cfdf78be723412df7a4", + "reference": "eeda578cbe24a170331a1cfdf78be723412df7a4", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2014-12-20 20:49:38" + }, + { + "name": "doctrine/cache", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8", + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7", + "predis/predis": "~0.8", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Cache\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2015-01-15 20:38:55" + }, + { + "name": "doctrine/collections", + "version": "v1.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2014-02-03 23:07:43" + }, + { + "name": "doctrine/common", + "version": "v2.4.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b", + "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2014-05-21 19:28:51" + }, + { + "name": "doctrine/dbal", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "628c2256b646ae2417d44e063bce8aec5199d48d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/628c2256b646ae2417d44e063bce8aec5199d48d", + "reference": "628c2256b646ae2417d44e063bce8aec5199d48d", + "shasum": "" + }, + "require": { + "doctrine/common": ">=2.4,<2.6-dev", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "symfony/console": "2.*" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\DBAL\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Database Abstraction Layer", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "dbal", + "persistence", + "queryobject" + ], + "time": "2015-01-12 21:52:47" + }, + { + "name": "doctrine/inflector", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2014-12-20 21:24:13" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09 13:34:57" + }, + { + "name": "doctrine/orm", + "version": "v2.4.7", + "source": { + "type": "git", + "url": "https://github.com/doctrine/doctrine2.git", + "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", + "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", + "shasum": "" + }, + "require": { + "doctrine/collections": "~1.1", + "doctrine/dbal": "~2.4", + "ext-pdo": "*", + "php": ">=5.3.2", + "symfony/console": "~2.0" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" + }, + "bin": [ + "bin/doctrine", + "bin/doctrine.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\ORM\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Object-Relational-Mapper for PHP", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "orm" + ], + "time": "2014-12-16 13:45:01" + }, + { + "name": "monolog/monolog", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "c41c218e239b50446fd883acb1ecfd4b770caeae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c41c218e239b50446fd883acb1ecfd4b770caeae", + "reference": "c41c218e239b50446fd883acb1ecfd4b770caeae", + "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, >2.4.8", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "phpunit/phpunit": "~4.0", + "raven/raven": "~0.5", + "ruflin/elastica": "0.90.*", + "swiftmailer/swiftmailer": "~5.3", + "videlalvaro/php-amqplib": "~2.4" + }, + "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", + "raven/raven": "Allow sending log messages to a Sentry server", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13.x-dev" + } + }, + "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" + ], + "time": "2015-03-05 01:12:12" + }, + { + "name": "oldsound/rabbitmq-bundle", + "version": "v1.6.0", + "target-dir": "OldSound/RabbitMqBundle", + "source": { + "type": "git", + "url": "https://github.com/videlalvaro/RabbitMqBundle.git", + "reference": "a15a4eba67324a24234280ace0afb5fc45605f3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/videlalvaro/RabbitMqBundle/zipball/a15a4eba67324a24234280ace0afb5fc45605f3b", + "reference": "a15a4eba67324a24234280ace0afb5fc45605f3b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/framework-bundle": "~2.1", + "symfony/yaml": "~2.0", + "videlalvaro/php-amqplib": "~2.4.0" + }, + "require-dev": { + "symfony/console": "~2.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "OldSound\\RabbitMqBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alvaro Videla" + } + ], + "description": "Integrates php-amqplib with Symfony2 and RabbitMq", + "keywords": [ + "Symfony2", + "message", + "queue", + "rabbitmq" + ], + "time": "2015-01-28 16:22:31" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "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", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "simple-bus/asynchronous", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/Asynchronous.git", + "reference": "67026c04a007eaf4dcef207cbb292f319e494ad1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/Asynchronous/zipball/67026c04a007eaf4dcef207cbb292f319e494ad1", + "reference": "67026c04a007eaf4dcef207cbb292f319e494ad1", + "shasum": "" + }, + "require": { + "beberlei/assert": "~2.0", + "php": ">=5.4", + "psr/log": "~1.0", + "simple-bus/message-bus": "~1.0", + "simple-bus/serialization": "dev-master" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "SimpleBus\\Asynchronous\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Generic classes and interfaces for asynchronous messaging using SimpleBus", + "homepage": "http://github.com/SimpleBus/Asynchronous", + "keywords": [ + "asynchronous", + "command bus", + "event bus", + "messaging" + ], + "time": "2015-03-09 13:32:19" + }, + { + "name": "simple-bus/asynchronous-bundle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/AsynchronousBundle.git", + "reference": "740c9834ecb9ddc4aaec6d22620536b9e44d8f3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/AsynchronousBundle/zipball/740c9834ecb9ddc4aaec6d22620536b9e44d8f3e", + "reference": "740c9834ecb9ddc4aaec6d22620536b9e44d8f3e", + "shasum": "" + }, + "require": { + "beberlei/assert": "~2.0", + "php": ">=5.4", + "simple-bus/asynchronous": "dev-master", + "simple-bus/message-bus": "~1.0", + "simple-bus/symfony-bridge": "^3.2.1", + "symfony/framework-bundle": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "symfony/monolog-bundle": "~2.3" + }, + "suggest": { + "symfony/monolog-bundle": "For logging messages" + }, + "type": "bundle", + "autoload": { + "psr-4": { + "SimpleBus\\AsynchronousBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Symfony bundle for using SimpleBus/Asynchronous", + "homepage": "http://github.com/SimpleBus/AsynchronousBundle", + "keywords": [ + "asynchronous", + "command bus", + "event bus", + "message", + "message bus" + ], + "time": "2015-03-11 15:54:45" + }, + { + "name": "simple-bus/message-bus", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/MessageBus.git", + "reference": "a7d0ef16b54f58537c4a5ca13073bef222dee321" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/MessageBus/zipball/a7d0ef16b54f58537c4a5ca13073bef222dee321", + "reference": "a7d0ef16b54f58537c4a5ca13073bef222dee321", + "shasum": "" + }, + "require": { + "beberlei/assert": "~2.0", + "php": ">=5.4", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "SimpleBus\\Message\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Generic classes and interfaces for messages and message buses", + "homepage": "http://github.com/SimpleBus/MessageBus", + "keywords": [ + "command bus", + "event bus", + "message", + "message bus" + ], + "time": "2015-02-27 20:19:39" + }, + { + "name": "simple-bus/rabbitmq-bundle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/RabbitMQBundle.git", + "reference": "9a84aa4ef88bf669c84604bc5c30a367855bb363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/RabbitMQBundle/zipball/9a84aa4ef88bf669c84604bc5c30a367855bb363", + "reference": "9a84aa4ef88bf669c84604bc5c30a367855bb363", + "shasum": "" + }, + "require": { + "beberlei/assert": "~2.0", + "oldsound/rabbitmq-bundle": "~1.0", + "php": ">=5.4", + "simple-bus/asynchronous": "dev-master", + "simple-bus/asynchronous-bundle": "dev-master", + "simple-bus/message-bus": "~1.0", + "symfony/monolog-bundle": "~2.3" + }, + "require-dev": { + "matthiasnoback/phpunit-asynchronicity": "dev-master", + "phpunit/phpunit": "~4.0", + "simple-bus/jms-serializer-bundle": "dev-master", + "symfony/console": "~2.0", + "symfony/finder": "~2.0", + "symfony/process": "~2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "SimpleBus\\RabbitMQBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Use RabbitMQ with SimpleBus/Asynchronous", + "homepage": "http://github.com/SimpleBus/RabbitMQBundle", + "keywords": [ + "command bus", + "event bus", + "message bus", + "messages", + "rabbitmq" + ], + "time": "2015-03-11 19:20:58" + }, + { + "name": "simple-bus/serialization", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/Serialization.git", + "reference": "a86cf4a59d57deb5dd441aecc326b1c0480ee72e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/Serialization/zipball/a86cf4a59d57deb5dd441aecc326b1c0480ee72e", + "reference": "a86cf4a59d57deb5dd441aecc326b1c0480ee72e", + "shasum": "" + }, + "require": { + "beberlei/assert": "~2.0", + "php": ">=5.4", + "simple-bus/message-bus": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "SimpleBus\\Serialization\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Generic classes and interfaces for serializing messages", + "homepage": "http://github.com/SimpleBus/Serialization", + "keywords": [ + "SimpleBus", + "messages", + "serialization" + ], + "time": "2015-03-10 08:11:41" + }, + { + "name": "simple-bus/symfony-bridge", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/SimpleBus/SymfonyBridge.git", + "reference": "e63b264ec4de5b0e67de5118b1d40755c80b22b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleBus/SymfonyBridge/zipball/e63b264ec4de5b0e67de5118b1d40755c80b22b9", + "reference": "e63b264ec4de5b0e67de5118b1d40755c80b22b9", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "simple-bus/message-bus": "^1.1.0", + "symfony/dependency-injection": "~2.3", + "symfony/http-kernel": "~2.3", + "symfony/yaml": "~2.3" + }, + "require-dev": { + "doctrine/doctrine-bundle": "~1.0", + "doctrine/orm": "~2.3", + "phpunit/phpunit": "~4.0", + "simple-bus/doctrine-orm-bridge": "~3.0", + "symfony/monolog-bundle": "~2.3" + }, + "suggest": { + "doctrine/doctrine-bundle": "For integration with Doctrine ORM", + "doctrine/orm": "For integration with Doctrine ORM", + "simple-bus/doctrine-orm-bridge": "For integration with Doctrine ORM", + "symfony/monolog-bundle": "For logging messages" + }, + "type": "library", + "autoload": { + "psr-4": { + "SimpleBus\\SymfonyBridge\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Noback", + "email": "matthiasnoback@gmail.com", + "homepage": "http://php-and-symfony.matthiasnoback.nl" + } + ], + "description": "Bridge for using command buses and event buses in Symfony projects", + "homepage": "http://github.com/SimpleBus/SymfonyBridge", + "keywords": [ + "command bus", + "doctrine", + "event bus", + "symfony" + ], + "time": "2015-03-10 15:26:04" + }, + { + "name": "symfony/config", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/a9f781ba1221067d1f07c8cec0bc50f81b8d7408", + "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2015-01-21 20:57:55" + }, + { + "name": "symfony/console", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + }, + { + "name": "symfony/debug", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Debug", + "source": { + "type": "git", + "url": "https://github.com/symfony/Debug.git", + "reference": "150c80059c3ccf68f96a4fceb513eb6b41f23300" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Debug/zipball/150c80059c3ccf68f96a4fceb513eb6b41f23300", + "reference": "150c80059c3ccf68f96a4fceb513eb6b41f23300", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2", + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2" + }, + "suggest": { + "symfony/http-foundation": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Debug\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Debug Component", + "homepage": "http://symfony.com", + "time": "2015-01-21 20:57:55" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.6.4", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "42bbb43fab66292a1865dc9616c299904c3d4d14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/42bbb43fab66292a1865dc9616c299904c3d4d14", + "reference": "42bbb43fab66292a1865dc9616c299904c3d4d14", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/expression-language": "~2.6", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.6.4", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f75989f3ab2743a82fe0b03ded2598a2b1546813", + "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/stopwatch": "~2.3" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2015-02-01 16:10:57" + }, + { + "name": "symfony/filesystem", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 21:13:09" + }, + { + "name": "symfony/framework-bundle", + "version": "v2.6.4", + "target-dir": "Symfony/Bundle/FrameworkBundle", + "source": { + "type": "git", + "url": "https://github.com/symfony/FrameworkBundle.git", + "reference": "91c0ab8cc6307953a38b8d543eed63b1693bf5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/FrameworkBundle/zipball/91c0ab8cc6307953a38b8d543eed63b1693bf5c5", + "reference": "91c0ab8cc6307953a38b8d543eed63b1693bf5c5", + "shasum": "" + }, + "require": { + "doctrine/annotations": "~1.0", + "php": ">=5.3.3", + "symfony/config": "~2.4", + "symfony/dependency-injection": "~2.6,>=2.6.2", + "symfony/event-dispatcher": "~2.5", + "symfony/filesystem": "~2.3", + "symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4", + "symfony/http-kernel": "~2.6", + "symfony/routing": "~2.2", + "symfony/security-core": "~2.6", + "symfony/security-csrf": "~2.6", + "symfony/stopwatch": "~2.3", + "symfony/templating": "~2.1", + "symfony/translation": "~2.6" + }, + "require-dev": { + "symfony/browser-kit": "~2.4", + "symfony/class-loader": "~2.1", + "symfony/console": "~2.5,>=2.5.2", + "symfony/css-selector": "~2.0,>=2.0.5", + "symfony/dom-crawler": "~2.0,>=2.0.5", + "symfony/expression-language": "~2.6", + "symfony/finder": "~2.0,>=2.0.5", + "symfony/form": "~2.6", + "symfony/intl": "~2.3", + "symfony/process": "~2.0,>=2.0.5", + "symfony/security": "~2.6", + "symfony/validator": "~2.5", + "symfony/yaml": "~2.0,>=2.0.5" + }, + "suggest": { + "doctrine/cache": "For using alternative cache drivers", + "symfony/console": "For using the console commands", + "symfony/finder": "For using the translation loader and cache warmer", + "symfony/form": "For using forms", + "symfony/validator": "For using validation", + "symfony/yaml": "For using the debug:config and yaml:lint commands" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Bundle\\FrameworkBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony FrameworkBundle", + "homepage": "http://symfony.com", + "time": "2015-02-01 16:10:57" + }, + { + "name": "symfony/http-foundation", + "version": "v2.6.4", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "8fa63d614d56ccfe033e30411d90913cfc483ff6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8fa63d614d56ccfe033e30411d90913cfc483ff6", + "reference": "8fa63d614d56ccfe033e30411d90913cfc483ff6", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/expression-language": "~2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com", + "time": "2015-02-01 16:10:57" + }, + { + "name": "symfony/http-kernel", + "version": "v2.6.4", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "27abf3106d8bd08562070dd4e2438c279792c434" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/27abf3106d8bd08562070dd4e2438c279792c434", + "reference": "27abf3106d8bd08562070dd4e2438c279792c434", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/debug": "~2.6,>=2.6.2", + "symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2", + "symfony/http-foundation": "~2.5,>=2.5.4" + }, + "require-dev": { + "symfony/browser-kit": "~2.3", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.0,>=2.0.5", + "symfony/console": "~2.3", + "symfony/css-selector": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.2", + "symfony/dom-crawler": "~2.0,>=2.0.5", + "symfony/expression-language": "~2.4", + "symfony/finder": "~2.0,>=2.0.5", + "symfony/process": "~2.0,>=2.0.5", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.3", + "symfony/templating": "~2.2", + "symfony/translation": "~2.0,>=2.0.5", + "symfony/var-dumper": "~2.6" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com", + "time": "2015-02-02 18:02:30" + }, + { + "name": "symfony/monolog-bridge", + "version": "v2.6.4", + "target-dir": "Symfony/Bridge/Monolog", + "source": { + "type": "git", + "url": "https://github.com/symfony/MonologBridge.git", + "reference": "83a451b5a2e16a14ffd07a42746c4b9db1a48c1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/MonologBridge/zipball/83a451b5a2e16a14ffd07a42746c4b9db1a48c1d", + "reference": "83a451b5a2e16a14ffd07a42746c4b9db1a48c1d", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.11", + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/console": "~2.4", + "symfony/event-dispatcher": "~2.2", + "symfony/http-kernel": "~2.4" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings. You need version ~2.3 of the console for it.", + "symfony/event-dispatcher": "Needed when using log messages in console commands", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel." + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Bridge\\Monolog\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Monolog Bridge", + "homepage": "http://symfony.com", + "time": "2015-01-03 08:01:59" + }, + { + "name": "symfony/monolog-bundle", + "version": "v2.7.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/MonologBundle.git", + "reference": "9320b6863404c70ebe111e9040dab96f251de7ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/MonologBundle/zipball/9320b6863404c70ebe111e9040dab96f251de7ac", + "reference": "9320b6863404c70ebe111e9040dab96f251de7ac", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.8", + "php": ">=5.3.2", + "symfony/config": "~2.3", + "symfony/dependency-injection": "~2.3", + "symfony/http-kernel": "~2.3", + "symfony/monolog-bridge": "~2.3" + }, + "require-dev": { + "symfony/console": "~2.3", + "symfony/yaml": "~2.3" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\MonologBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony MonologBundle", + "homepage": "http://symfony.com", + "keywords": [ + "log", + "logging" + ], + "time": "2015-01-04 20:21:17" + }, + { + "name": "symfony/routing", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing.git", + "reference": "bda1c3c67f2a33bbeabb1d321feaf626a0ca5698" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Routing/zipball/bda1c3c67f2a33bbeabb1d321feaf626a0ca5698", + "reference": "bda1c3c67f2a33bbeabb1d321feaf626a0ca5698", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4", + "symfony/http-foundation": "~2.3", + "symfony/yaml": "~2.0,>=2.0.5" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2015-01-15 12:15:12" + }, + { + "name": "symfony/security-core", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Security/Core", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-core.git", + "reference": "4603bcc66e20e23f018c67f7f9f3f8146a100c11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-core/zipball/4603bcc66e20e23f018c67f7f9f3f8146a100c11", + "reference": "4603bcc66e20e23f018c67f7f9f3f8146a100c11", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "ircmaxell/password-compat": "1.0.*", + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/expression-language": "~2.6", + "symfony/http-foundation": "~2.4", + "symfony/translation": "~2.0,>=2.0.5", + "symfony/validator": "~2.5,>=2.5.5" + }, + "suggest": { + "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5", + "symfony/event-dispatcher": "", + "symfony/expression-language": "For using the expression voter", + "symfony/http-foundation": "", + "symfony/validator": "For using the user password constraint" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Security\\Core\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Security Component - Core Library", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + }, + { + "name": "symfony/security-csrf", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Security/Csrf", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-csrf.git", + "reference": "c532081e1c9295b69dac2e3faea87112543504fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/c532081e1c9295b69dac2e3faea87112543504fc", + "reference": "c532081e1c9295b69dac2e3faea87112543504fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/security-core": "~2.4" + }, + "require-dev": { + "symfony/http-foundation": "~2.1" + }, + "suggest": { + "symfony/http-foundation": "For using the class SessionTokenStorage." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Security\\Csrf\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Security Component - CSRF Library", + "homepage": "http://symfony.com", + "time": "2015-01-03 08:01:59" + }, + { + "name": "symfony/stopwatch", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Stopwatch", + "source": { + "type": "git", + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Stopwatch\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 08:01:59" + }, + { + "name": "symfony/templating", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Templating", + "source": { + "type": "git", + "url": "https://github.com/symfony/Templating.git", + "reference": "2468e748c0583273fbd164de20b4d037ba55ee58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Templating/zipball/2468e748c0583273fbd164de20b4d037ba55ee58", + "reference": "2468e748c0583273fbd164de20b4d037ba55ee58", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0" + }, + "suggest": { + "psr/log": "For using debug logging in loaders" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Templating\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Templating Component", + "homepage": "http://symfony.com", + "time": "2015-01-05 17:57:42" + }, + { + "name": "symfony/translation", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Translation", + "source": { + "type": "git", + "url": "https://github.com/symfony/Translation.git", + "reference": "f289cdf8179d32058c1e1cbac723106a5ff6fa39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Translation/zipball/f289cdf8179d32058c1e1cbac723106a5ff6fa39", + "reference": "f289cdf8179d32058c1e1cbac723106a5ff6fa39", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.3,>=2.3.12", + "symfony/intl": "~2.3", + "symfony/yaml": "~2.2" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Translation Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 15:33:07" + }, + { + "name": "symfony/yaml", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + }, + { + "name": "videlalvaro/php-amqplib", + "version": "v2.4.1", + "source": { + "type": "git", + "url": "https://github.com/videlalvaro/php-amqplib.git", + "reference": "58044157b30853a1a425e26e9ff9895247668ac3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/videlalvaro/php-amqplib/zipball/58044157b30853a1a425e26e9ff9895247668ac3", + "reference": "58044157b30853a1a425e26e9ff9895247668ac3", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "suggest": { + "ext-sockets": "Use AMQPSocketConnection" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpAmqpLib": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Alvaro Videla" + } + ], + "description": "This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", + "homepage": "https://github.com/videlalvaro/php-amqplib/", + "keywords": [ + "message", + "queue", + "rabbitmq" + ], + "time": "2014-10-06 11:00:55" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "simple-bus/rabbitmq-bundle": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [] +} diff --git a/src/Bundle/LongRunningBundle/DependencyInjection/Compiler/RegisterCleanersPass.php b/src/Bundle/LongRunningBundle/DependencyInjection/Compiler/RegisterCleanersPass.php new file mode 100644 index 0000000..a65c2a1 --- /dev/null +++ b/src/Bundle/LongRunningBundle/DependencyInjection/Compiler/RegisterCleanersPass.php @@ -0,0 +1,26 @@ +has($delegatingCleanerId))) { + return; + } + + $cleanerReferences = []; + foreach ($container->findTaggedServiceIds('long_running.cleaner') as $serviceId => $tags) { + $cleanerReferences[] = new Reference($serviceId); + } + + $delegatingCleaner = $container->findDefinition($delegatingCleanerId); + $delegatingCleaner->replaceArgument(0, $cleanerReferences); + } +} diff --git a/src/Bundle/LongRunningBundle/DependencyInjection/Configuration.php b/src/Bundle/LongRunningBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000..b37d9c5 --- /dev/null +++ b/src/Bundle/LongRunningBundle/DependencyInjection/Configuration.php @@ -0,0 +1,43 @@ +alias = $alias; + } + + public function getConfigTreeBuilder() + { + $treeBuilder = new TreeBuilder(); + + $rootNode = $treeBuilder->root($this->alias); + $rootNode + ->children() + ->arrayNode('doctrine_orm') + ->canBeEnabled() + ->end() + ->arrayNode('doctrine_dbal') + ->addDefaultsIfNotSet() + ->canBeEnabled() + ->children() + ->arrayNode('connections') + ->requiresAtLeastOnElement() + ->prototype('scalar') + ->end() + ->end() + ->end() + ->end() + ->arrayNode('simple_bus_rabbit_mq') + ->canBeEnabled() + ->end() + ->end(); + + return $treeBuilder; + } +} diff --git a/src/Bundle/LongRunningBundle/DependencyInjection/LongRunningExtension.php b/src/Bundle/LongRunningBundle/DependencyInjection/LongRunningExtension.php new file mode 100644 index 0000000..4bdb8c1 --- /dev/null +++ b/src/Bundle/LongRunningBundle/DependencyInjection/LongRunningExtension.php @@ -0,0 +1,75 @@ +alias = $alias; + } + + protected function loadInternal(array $mergedConfig, ContainerBuilder $container) + { + $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.yml'); + + if ($mergedConfig['doctrine_orm']['enabled']) { + $loader->load('doctrine_orm.yml'); + } + + if ($mergedConfig['doctrine_dbal']['enabled']) { + $loader->load('doctrine_dbal.yml'); + } + + if ($mergedConfig['simple_bus_rabbit_mq']['enabled']) { + $loader->load('simple_bus_rabbit_mq.yml'); + } + } + + public function getConfiguration(array $config, ContainerBuilder $container) + { + return new Configuration($this->getAlias()); + } + + public function getAlias() + { + return $this->alias; + } + + public function prepend(ContainerBuilder $container) + { + $enabledBundles = $container->getParameter('kernel.bundles'); + + if (isset($enabledBundles['DoctrineBundle'])) { + $container->prependExtensionConfig($this->getAlias(), [ + 'doctrine_orm' => [ + 'enabled' => true + ], + 'doctrine_dbal' => [ + 'enabled' => true + ] + ]); + } + if (isset($enabledBundles['SimpleBusRabbitMQBundle'])) { + $container->prependExtensionConfig($this->getAlias(), [ + 'simple_bus_rabbit_mq' => [ + 'enabled' => true + ] + ]); + } + } +} diff --git a/src/Bundle/LongRunningBundle/LongRunningBundle.php b/src/Bundle/LongRunningBundle/LongRunningBundle.php new file mode 100644 index 0000000..76d9e9f --- /dev/null +++ b/src/Bundle/LongRunningBundle/LongRunningBundle.php @@ -0,0 +1,21 @@ +addCompilerPass(new RegisterCleanersPass()); + } +} diff --git a/src/Bundle/LongRunningBundle/Resources/doctrine_dbal.yml b/src/Bundle/LongRunningBundle/Resources/doctrine_dbal.yml new file mode 100644 index 0000000..b7c8fc7 --- /dev/null +++ b/src/Bundle/LongRunningBundle/Resources/doctrine_dbal.yml @@ -0,0 +1,8 @@ +services: + long_running.doctrine_dbal.close_connections: + class: LongRunning\Plugin\DoctrineDBALPlugin\CloseConnections + public: false + arguments: + - @doctrine + tags: + - { name: long_running.cleaner } diff --git a/src/Bundle/LongRunningBundle/Resources/doctrine_orm.yml b/src/Bundle/LongRunningBundle/Resources/doctrine_orm.yml new file mode 100644 index 0000000..3973f3c --- /dev/null +++ b/src/Bundle/LongRunningBundle/Resources/doctrine_orm.yml @@ -0,0 +1,16 @@ +services: + long_running.doctrine_orm.clear_entity_managers: + class: LongRunning\Plugin\DoctrineORMPlugin\ClearEntityManagers + public: false + arguments: + - @doctrine + tags: + - { name: long_running.cleaner } + + long_running.doctrine_orm.reset_closed_entity_managers: + class: LongRunning\Plugin\DoctrineORMPlugin\ResetClosedEntityManagers + public: false + arguments: + - @doctrine + tags: + - { name: long_running.cleaner } diff --git a/src/Bundle/LongRunningBundle/Resources/services.yml b/src/Bundle/LongRunningBundle/Resources/services.yml new file mode 100644 index 0000000..f73dca4 --- /dev/null +++ b/src/Bundle/LongRunningBundle/Resources/services.yml @@ -0,0 +1,6 @@ +services: + long_running.delegating_cleaner: + class: LongRunning\Core\DelegatingCleaner + arguments: + # will be populated by RegisterCleanersPass + - [] diff --git a/src/Bundle/LongRunningBundle/Resources/simple_bus_rabbit_mq.yml b/src/Bundle/LongRunningBundle/Resources/simple_bus_rabbit_mq.yml new file mode 100644 index 0000000..acfa6fb --- /dev/null +++ b/src/Bundle/LongRunningBundle/Resources/simple_bus_rabbit_mq.yml @@ -0,0 +1,7 @@ +services: + long_running.simple_bus_rabbit_mq.when_message_consumed_or_failed_clean_up: + class: LongRunning\Plugin\SimpleBusRabbitMQPlugin\WhenMessageConsumedOrFailedCleanUp + arguments: + - @long_running.delegating_cleaner + tags: + - { name: kernel.event_subscriber } diff --git a/src/Core/Cleaner.php b/src/Core/Cleaner.php new file mode 100644 index 0000000..082da5a --- /dev/null +++ b/src/Core/Cleaner.php @@ -0,0 +1,8 @@ +cleaners = $cleaners; + } + + public function cleanUp() + { + foreach ($this->cleaners as $cleaner) { + $cleaner->cleanUp(); + } + } +} diff --git a/src/Plugin/DoctrineDBALPlugin/CloseConnections.php b/src/Plugin/DoctrineDBALPlugin/CloseConnections.php new file mode 100644 index 0000000..38e2bd4 --- /dev/null +++ b/src/Plugin/DoctrineDBALPlugin/CloseConnections.php @@ -0,0 +1,31 @@ +connectionRegistry = $connectionRegistry; + } + + public function cleanUp() + { + foreach ($this->connectionRegistry->getConnections() as $connection) { + if (!($connection instanceof Connection)) { + throw new \LogicException('Expected only instances of Connection'); + } + + $connection->close(); + } + } +} diff --git a/src/Plugin/DoctrineORMPlugin/ClearEntityManagers.php b/src/Plugin/DoctrineORMPlugin/ClearEntityManagers.php new file mode 100644 index 0000000..0b3bde4 --- /dev/null +++ b/src/Plugin/DoctrineORMPlugin/ClearEntityManagers.php @@ -0,0 +1,26 @@ +managerRegistry = $managerRegistry; + } + + public function cleanUp() + { + foreach ($this->managerRegistry->getManagers() as $manager) { + $manager->clear(); + } + } +} diff --git a/src/Plugin/DoctrineORMPlugin/ResetClosedEntityManagers.php b/src/Plugin/DoctrineORMPlugin/ResetClosedEntityManagers.php new file mode 100644 index 0000000..710cd82 --- /dev/null +++ b/src/Plugin/DoctrineORMPlugin/ResetClosedEntityManagers.php @@ -0,0 +1,33 @@ +managerRegistry = $managerRegistry; + } + + public function cleanUp() + { + foreach ($this->managerRegistry->getManagers() as $name => $manager) { + if (!($manager instanceof EntityManager)) { + throw new \LogicException('Expected only instances of EntityManager'); + } + + if (!$manager->isOpen()) { + $this->managerRegistry->resetManager($name); + } + } + } +} diff --git a/src/Plugin/SimpleBusRabbitMQPlugin/WhenMessageConsumedOrFailedCleanUp.php b/src/Plugin/SimpleBusRabbitMQPlugin/WhenMessageConsumedOrFailedCleanUp.php new file mode 100644 index 0000000..6686bcd --- /dev/null +++ b/src/Plugin/SimpleBusRabbitMQPlugin/WhenMessageConsumedOrFailedCleanUp.php @@ -0,0 +1,33 @@ +cleaner = $cleaner; + } + + public static function getSubscribedEvents() + { + return [ + Events::MESSAGE_CONSUMED => ['messageConsumedOrFailed', -1000], + Events::MESSAGE_CONSUMPTION_FAILED => ['messageConsumedOrFailed', -1000] + ]; + } + + public function messageConsumedOrFailed() + { + $this->cleaner->cleanUp(); + } +}