Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
eb67103
feat: add Symfony-based container implementation to main package
dgafka Jun 11, 2026
cadba1f
feat: add dumped container cache and symfony/dependency-injection req…
dgafka Jun 11, 2026
0a5e551
feat: switch EcotoneLite to Symfony-based container with dumped cache
dgafka Jun 11, 2026
d93aed5
feat: expose registered console commands as container parameter
dgafka Jun 11, 2026
75ecb9b
fix: cache external reference resolutions like LazyInMemoryContainer did
dgafka Jun 11, 2026
d6465a8
feat: switch Laravel integration to side-car Symfony container with b…
dgafka Jun 11, 2026
3375c52
feat: switch Symfony bundle to side-car Ecotone container with bridge…
dgafka Jun 11, 2026
4023e5e
feat: switch Tempest integration to side-car Symfony container
dgafka Jun 11, 2026
f945b2a
feat: switch LiteApplication to shared Symfony container, drop PHP-DI
dgafka Jun 11, 2026
85a5769
refactor: remove in-memory and PHP-DI container implementations
dgafka Jun 11, 2026
08fe241
refactor: expose typed container accessors for integration metadata
dgafka Jun 11, 2026
35c4988
refactor: add bootstrap entry point consolidating cache-or-build flow
dgafka Jun 11, 2026
5027f9b
refactor: share cache layout resolution across integrations
dgafka Jun 11, 2026
77d80b2
refactor: share gateway bridge registration and align container pass …
dgafka Jun 11, 2026
64a2b0e
Merge origin/main into feat/container-support
dgafka Jun 12, 2026
6fe311b
fix: prefer Ecotone definitions over user instances when autowiring i…
dgafka Jun 12, 2026
5a15c77
fix(ci): isolate temp directory per component to avoid parallel phpst…
dgafka Jun 12, 2026
a20e01a
optimization
dgafka Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/split-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ jobs:
local run_tests_cmd="$3"
local overall_exit_code=0
# Isolate temp directory per component, so parallel PHPStan runs do not race on a shared /tmp/phpstan cache
local tmp_slug=$(echo "$dir" | tr '/.-' '___' | tr '[:upper:]' '[:lower:]')
local component_tmp_dir="/tmp/ecotone_component_${tmp_slug}"
mkdir -p "$component_tmp_dir"
run_tests_cmd="TMPDIR='${component_tmp_dir}' ${run_tests_cmd}"
# Install dependencies and determine if MySQL pass is needed (direct or transitive doctrine/dbal)
if ! _run_tests "Install composer dependencies ($dir)" "cd '${dir}' && ${compose_up_cmd}"; then
overall_exit_code=1
Expand Down

This file was deleted.

47 changes: 0 additions & 47 deletions Monorepo/CrossModuleTests/Tests/SimpleSymfonyKernel.php

This file was deleted.

31 changes: 0 additions & 31 deletions Monorepo/CrossModuleTests/Tests/SymfonyContainerAdapterTest.php

This file was deleted.

1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
"symfony/console": "^6.4|^7.0|^8.0",
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"php-di/php-di": "^7.0.5",
"open-telemetry/sdk": "^1.0.0",
"psr/container": "^1.1.1|^2.0.1",
"psr/clock": "^1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/Ecotone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"psr/clock": "^1.0",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^2.0|^3.0",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"symfony/uid": "^6.4|^7.0|^8.0"
},
"require-dev": {
Expand Down
81 changes: 32 additions & 49 deletions packages/Ecotone/src/Lite/EcotoneLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ecotone\Lite;

use Ecotone\AnnotationFinder\AnnotationFinderFactory;
use Ecotone\AnnotationFinder\FileSystem\FileSystemAnnotationFinder;
use Ecotone\AnnotationFinder\FileSystem\RootCatalogNotFound;
use Ecotone\Dbal\Configuration\DbalConfiguration;
Expand All @@ -15,7 +14,6 @@
use Ecotone\Lite\Test\TestConfiguration;
use Ecotone\Messaging\Channel\MessageChannelBuilder;
use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
use Ecotone\Messaging\Config\Container\ContainerConfig;
use Ecotone\Messaging\Config\MessagingSystemConfiguration;
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ServiceCacheConfiguration;
Expand All @@ -24,6 +22,8 @@
use Ecotone\Messaging\InMemoryConfigurationVariableService;
use Ecotone\Messaging\Support\Assert;
use Ecotone\Modelling\BaseEventSourcingConfiguration;
use Ecotone\SymfonyContainer\ContainerCacheLayout;
use Ecotone\SymfonyContainer\EcotoneSymfonyContainerFactory;

use function json_decode;

Expand Down Expand Up @@ -202,63 +202,46 @@ private static function prepareConfiguration(ContainerInterface|array $container
$externalContainer = $containerOrAvailableServices instanceof ContainerInterface ? $containerOrAvailableServices : InMemoryPSRContainer::createFromAssociativeArray($containerOrAvailableServices);
$serviceConfiguration = MessagingSystemConfiguration::addCorePackage($serviceConfiguration, $enableTesting);

$annotationFinder = AnnotationFinderFactory::createForAttributes(
realpath($pathToRootCatalog),
$serviceConfiguration->getNamespaces(),
$serviceConfiguration->getEnvironment(),
$serviceConfiguration->getLoadedCatalog() ?? '',
MessagingSystemConfiguration::getModuleClassesFor($serviceConfiguration),
$classesToResolve,
$enableTesting
);
$cacheHash = $annotationFinder->getCacheMessagingFileNameBasedOnConfig($pathToRootCatalog, $serviceConfiguration, $configurationVariables, $enableTesting);
$serviceCacheConfiguration = new ServiceCacheConfiguration(
$serviceConfiguration->getCacheDirectoryPath() . DIRECTORY_SEPARATOR . $cacheHash,
$cacheLayout = ContainerCacheLayout::resolve(
$pathToRootCatalog,
$serviceConfiguration,
$serviceConfiguration->getCacheDirectoryPath(),
self::shouldUseAutomaticCache($useCachedVersion, $pathToRootCatalog),
configurationVariables: $configurationVariables,
classesToResolve: $classesToResolve,
enableTesting: $enableTesting,
);
$annotationFinder = $cacheLayout->annotationFinder;
$serviceCacheConfiguration = $cacheLayout->serviceCacheConfiguration;
$cacheHash = $cacheLayout->configHash;

$configurationVariableService = InMemoryConfigurationVariableService::create($configurationVariables);
$definitionHolder = null;
$messagingSystemCachePath = $serviceCacheConfiguration->getPath() . DIRECTORY_SEPARATOR . 'messaging';

if ($serviceCacheConfiguration->shouldUseCache() && file_exists($messagingSystemCachePath)) {
/** It may fail on deserialization, then return `false` and we can build new one */
$definitionHolder = unserialize(file_get_contents($messagingSystemCachePath));
}

if (! $definitionHolder) {
$messagingConfiguration = MessagingSystemConfiguration::prepareWithAnnotationFinder(
$annotationFinder,
$configurationVariableService,
$serviceConfiguration,
$enableTesting
);

$messagingConfiguration->withExternalContainer($externalContainer);

$definitionHolder = ContainerConfig::buildDefinitionHolder($messagingConfiguration);

if ($serviceCacheConfiguration->shouldUseCache()) {
Assert::notNull($messagingSystemCachePath, 'Cache path should be defined');

MessagingSystemConfiguration::prepareCacheDirectory($serviceCacheConfiguration);
file_put_contents($messagingSystemCachePath, serialize($definitionHolder));
}
}

$container = new LazyInMemoryContainer($definitionHolder->getDefinitions(), $externalContainer);
$container->set(ServiceCacheConfiguration::class, $serviceCacheConfiguration);
$container->set(ConfigurationVariableService::REFERENCE_NAME, $configurationVariableService);
$container = EcotoneSymfonyContainerFactory::bootstrap(
$serviceCacheConfiguration,
$configurationVariableService,
$externalContainer,
function () use ($annotationFinder, $configurationVariableService, $serviceConfiguration, $enableTesting, $externalContainer) {
$messagingConfiguration = MessagingSystemConfiguration::prepareWithAnnotationFinder(
$annotationFinder,
$configurationVariableService,
$serviceConfiguration,
$enableTesting
);
$messagingConfiguration->withExternalContainer($externalContainer);

return $messagingConfiguration;
},
$cacheHash,
);

$messagingSystem = $container->get(ConfiguredMessagingSystem::class);

if ($allowGatewaysToBeRegisteredInContainer) {
Assert::isTrue(method_exists($externalContainer, 'set'), 'Gateways registration was enabled however given container has no `set` method. Please add it or turn off the option.');
$externalContainer->set(ConfiguredMessagingSystem::class, $messagingSystem);
foreach ($messagingSystem->getGatewayList() as $gatewayReference) {
$gatewayReferenceName = $gatewayReference->getReferenceName();
$externalContainer->set($gatewayReferenceName, $messagingSystem->getGatewayByName($gatewayReferenceName));
}
$container->registerBridgesInto(
fn (string $referenceName, string $interfaceName, callable $factory) => $externalContainer->set($referenceName, $factory()),
);
} elseif ($externalContainer->has(ConfiguredMessagingSystem::class)) {
/** @var ConfiguredMessagingSystem $alreadyConfiguredMessaging */
$alreadyConfiguredMessaging = $externalContainer->get(ConfiguredMessagingSystem::class);
Expand Down
119 changes: 0 additions & 119 deletions packages/Ecotone/src/Lite/InMemoryContainerImplementation.php

This file was deleted.

Loading
Loading