ibexa/doctrine-schema
A Symfony bundle providing a cross-DBMS schema import abstraction layer. It defines a custom YAML schema format and autowired APIs, plus an event-driven SchemaBuilder and interfaces for importing and exporting Doctrine DBAL schema objects.
Architecture fit
SchemaImporterInterface (YAML string/file → Doctrine\DBAL\Schema), SchemaExporterInterface (Doctrine\DBAL\Schema → YAML), and SchemaBuilderInterface (event-driven aggregation of multiple YAML sources into one schema). This is an unopinionated seam, not a framework — it does not own migrations, connection management, or DDL execution.SchemaBuilderEvents::BUILD_SCHEMA, which maps cleanly onto modular monolith or plugin architectures where schema ownership should be distributed.Integration feasibility
EventSubscriber. The README's two code samples are sufficient to get a working proof of concept in under a day for a Doctrine-fluent engineer.DatabasePlatformResolver) and 5.0.x (current). Choosing wrong means either a dead end or an unsupported PHP/Symfony baseline.Technical risk
NOASSERTION is accurate: the package is dual-licensed under the Ibexa Business Use License (requires a paid Ibexa DXP subscription) or GPL-2.0. GPL-2.0 is copyleft and, for a PHP library linked into an application, is widely treated as infectious. Most commercial products cannot adopt this without either a subscription or a legal opinion. This single item can invalidate the entire evaluation.DatabasePlatformResolver addition signals that DBAL version drift has already caused breakage — cross-DBAL-version platform detection is a symptom of a moving dependency.Schema object), but only if planned for up front.Key questions
Schema mapping or doctrine/doctrine-migrations may cover 80% at zero license risk.Stack fit
doctrine/doctrine-bundle rather than replacing it — it feeds Schema objects into whatever already consumes them.Migration path
SchemaBuilder + subscribers per module, generate DDL from the resulting Schema object. Lowest cost, cleanest ownership.SchemaExporterInterface on the live/introspected Schema and diff against the handwritten YAML. This is the single highest-value use of the exporter: it turns an opaque format into a verifiable one and gives a free conformance test.Schema/SQL dump if the package is dropped. Make this a hard exit criterion.Compatibility
^4.6 vs ^5.0) and pin DBAL. The DatabasePlatformResolver work in 4.6.32 exists because DBAL's platform-detection APIs moved; assume this is a recurring seam and let Composer enforce it.Sequencing
Maintenance
class_alias BC layers and raised PHP to 8.3 — a breaking step teams must absorb).Support
Scaling
SchemaBuilder assembles the full schema from all registered subscribers on each build. With many modules and large schemas, build time grows with contributor count. Cache the built schema artifact per release rather than rebuilding per deploy target.Failure modes
buildSchema() as atomic/fail-fast — assert full expected table count.DatabasePlatformResolver exists because this already happened. Pin DBAL, run the DBMS fixture matrix on upgrades, and treat any DBAL major as a scheduled project.Ramp-up
How can I help you explore Laravel packages today?