Installation
Installing Ecotone for Symfony, Laravel or Stand Alone
- 1.Use composer in order to download
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]
- 1.Use composer in order to download
Ecotone Laravel
Provider should be automatically registered.
2. Register provider, if needed
'providers' => [
\Ecotone\Laravel\EcotoneProvider::class
],
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.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.If you already have Dependency Container configured, then:
composer require ecotone/ecotone
$ecotoneLite = EcotoneLite::bootstrap(
containerOrAvailableServices: $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 modified 5mo ago