Installation
Installing Ecotone for Symfony, Laravel or Stand Alone

Install for Symfony

  1. 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. 1.
    Use composer in order to download Ecotone Laravel
composer require ecotone/laravel
Provider should be automatically registered.
2. Register provider, if needed
1
'providers' => [
2
\Ecotone\Laravel\EcotoneProvider::class
3
],
Copied!

Install Lite (No framework)

Make use of prepared setup

Wire manually

  1. 1.
    In order to start we have to have composer.json with PSR-4 or PSR-0 autoload setup. Create composer.json in root catalog with autoload for src catalog. And add Ecotone
composer require ecotone/ecotone
2. As Ecotone require access to Dependency Container, you have to choose one in order to run the example. As Ecotone may register classes for easier usage, we will make our container implement GatewayAwareContainer to access them.
Create console.php and set up your container (look #13 line)
1
use Ecotone\Lite\EcotoneLiteConfiguration;
2
use Ecotone\Lite\GatewayAwareContainer;
3
use Ecotone\Messaging\Config\ServiceConfiguration;
4
5
$rootCatalog = __DIR__;
6
require $rootCatalog . "/vendor/autoload.php";
7
8
$container = new class() implements GatewayAwareContainer {
9
private Container $container;
10
11
public function __construct()
12
{
13
$this->container = // @TODO set up your container here
14
}
15
16
public function get($id)
17
{
18
return $this->container->get($id);
19
}
20
21
public function has($id)
22
{
23
return $this->container->has($id);
24
}
25
26
public function addGateway(string $referenceName, object $gateway): void
27
{
28
$this->container->set($referenceName, $gateway);
29
}
30
};
31
32
$messagingSystem = EcotoneLiteConfiguration::createWithConfiguration(
33
$rootCatalog,
34
$container,
35
ServiceConfiguration::createWithDefaults()
36
->withLoadCatalog("src"),
37
[],
38
false
39
);
Copied!
Last modified 8mo ago