-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
46 lines (38 loc) · 1.03 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
use DI\Container;
use Ecotone\Lite\EcotoneLiteConfiguration;
use Ecotone\Lite\GatewayAwareContainer;
use Ecotone\Messaging\Config\ServiceConfiguration;
$rootCatalog = __DIR__;
require $rootCatalog . "/vendor/autoload.php";
$container = new class() implements GatewayAwareContainer {
private Container $container;
public function __construct()
{
$this->container = new Container();
}
public function get($id)
{
return $this->container->get($id);
}
public function has($id)
{
return $this->container->has($id);
}
public function set(string $id, object $service)
{
$this->container->set($id, $service);
}
public function addGateway(string $referenceName, object $gateway): void
{
$this->container->set($referenceName, $gateway);
}
};
$messagingSystem = EcotoneLiteConfiguration::createWithConfiguration(
$rootCatalog,
$container,
ServiceConfiguration::createWithDefaults()
->withLoadCatalog("src"),
[],
false
);