Use composer in order to download Ecotone Symfony Bundle
composer require ecotone/symfony-bundle
If you're using Symfony Flex
, bundle will auto-configure.
2. Register bundle, if needed
new Ecotone\SymfonyBundle\EcotoneSymfonyBundle::class => ['all' => true]
Use composer in order to download Ecotone Laravel
composer require ecotone/laravel
Provider should be automatically registered.
2. Register provider, if needed
'providers' => [\Ecotone\Laravel\EcotoneProvider::class],
Use composer in order to download Ecotone
composer require ecotone/ecotone
2. Boostrap Ecotone
use Ecotone\Lite\EcotoneLiteConfiguration;use Ecotone\Lite\InMemoryPSRContainer;use Ecotone\Messaging\Config\ApplicationConfiguration;$rootCatalog = "/var/www/html"; // path to root of your project, where composer.json exists$namespacesToUse = ["Example\Modelling\EventSourcing"]; // list of namespaces, that should be boostraped by Ecotone$psr11CompatibleContainer = InMemoryPSRContainer::createFromObjects([TicketRepository::createEmpty()]); // you may use existing in memory implemantation for testing purposes$messagingSystem = EcotoneLiteConfiguration::createWithConfiguration($rootCatalog,$psr11CompatibleContainer,ApplicationConfiguration::createWithDefaults()->withNamespaces($namespacesToUse));
Ecotone is heavily based on annotations to avoid coupling domain with framework code. PHPStorm has great plugin, which allow auto-complete for annotations: https://plugins.jetbrains.com/plugin/7320-php-annotations