Installing Ecotone for Symfony, Laravel or Stand Alone

Install for Symfony

  1. 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]

Install for Laravel

  1. Use composer in order to download Ecotone Laravel

composer require ecotone/laravel

Provider should be automatically registered.

2. Register provider, if needed

'providers' => [

Install Ecotone Lite (No framework)

If you're using no framework or framework different than Symfony or Laravel, then you may use Ecotone Lite to bootstrap Ecotone.

In order to start, you need have to composer.json with PSR-4 or PSR-0 autoload setup.

Ecotone Lite Application

You may use out of the box Ecotone Lite Application, which provide you with Dependency Container.

composer require ecotone/lite-application

$ecotoneLite = EcotoneLiteApplication::bootstrap();

$commandBus = $ecotoneLite->getCommandBus();
$queryBus = $ecotoneLite->getQueryBus();

With default configuration, Ecotone will look for classes inside src catalog.

With Custom Dependency Container

If you already have Dependency Container configured, then:

composer require ecotone/ecotone

$ecotoneLite = EcotoneLite::bootstrap(
    containerOrAvailableServices: $container

With no Dependency Container

You may actually run Ecotone without any Dependency Container. That may be useful for small applications, testing or when we want just run some Ecotone's script.

composer require ecotone/ecotone

$ecotoneLite = EcotoneLite::bootstrap(
    [User::class, UserRepository::class, UserService::class],
    [new UserRepository(), new UserService()]

Last updated