Skip to content

Upgrade to Symfony bundle 3.0.0

The released small/swoole-entity-manager-bundle 3.0.0 integrates Small Swoole Entity Manager Core 3.0.x with Symfony 7.4 or 8.x.

Update dependencies

Run:

composer require 'small/swoole-entity-manager-bundle:^3.0' -W

The 3.0.0 package declares:

Dependency Composer constraint
PHP >=8.3
small/swoole-entity-manager-core 3.0.*
Symfony Config, Console, DependencyInjection, HttpKernel ^7.4 || ^8.0

The bundle has no PHP upper-bound constraint. Check Core, Swoole/OpenSwoole extensions, and your full application against the runtime actually deployed.

Check your services

Continue injecting the public factory contracts:

use Small\SwooleEntityManagerBundle\Contract\ConnectionFactoryInterface;
use Small\SwooleEntityManagerBundle\Contract\EntityManagerFactoryInterface;

ConnectionFactoryInterface::get(?string $connectionName = null) returns the default or named Core connection. EntityManagerFactoryInterface::get(string $managerClass, bool $new = false) returns a cached manager by default. Call reset() at request/job boundaries if your persistent worker does not invoke Symfony's kernel.reset.

Review configuration

The bundle uses AbstractBundle::configure() and loadExtension(). The legacy DependencyInjection/Configuration and SmallSwooleEntityManagerExtension classes remain deprecated compatibility placeholders: do not extend or invoke them in new integrations.

Connection types are mysql, postgres, and swoole-db. SQL connections require host, database, user, password, and encoding; port and max_connections are optional. The default connection must exist when any connections are configured.

See Get started for a complete configuration.

Database layers

Only values configured in layer_parameters are passed to Core. The command executes all configured selectors by default or a single one with --selector:

bin/console swoole:entity-manager:layers:execute --selector=app

Missing configuration and unknown selectors yield a non-zero exit status.

Verify the migration

  1. Run composer validate and check the resolved packages with composer show small/swoole-entity-manager-bundle small/swoole-entity-manager-core (or inspect them individually if your Composer version requires it).
  2. Boot your Symfony application and verify the two factory contracts resolve from the container.
  3. Exercise a configured connection, manager lookup, and the database-layer command against an isolated test database.
  4. Run your application test suite, including long-running worker reset scenarios.

The v2 migration notes remain available for applications upgrading from older bundle lines.