Skip to content

Fix Symfony Flex not registering the bundle - #78

Merged
mnapoli merged 1 commit into
masterfrom
flex-registers-bundle
Sep 26, 2026
Merged

mnapoli merged 1 commit into
masterfrom
flex-registers-bundle

Conversation

@mnapoli

@mnapoli mnapoli commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

BrefBundle enables Bref's CloudWatch log formatter on all Monolog handlers (#73), but the config that was supposed to register it didn't work.

Why: the Flex configuration was invalid, and without one Flex auto-registers the bundle class it can guess from the PSR-4 namespace: for Bref\SymfonyBridge\ it looks for SymfonyBridgeBundle or BrefSymfonyBridgeBundle (Symfony's <Vendor><Package>Bundle convention), whatever the package type.

This renames the bundle to BrefSymfonyBridgeBundle, keeps BrefBundle as a deprecated subclass for applications that registered it by hand, and removes the extra key.

Existing applications: nothing changes for them, and nothing breaks. Flex only applies recipes when a package is installed, so updating the bridge leaves config/bundles.php untouched: their logs keep the format they have today, and applications that registered BrefBundle by hand keep working. To get Bref's log format (and the request ID), they should add this line:

Bref\SymfonyBridge\BrefSymfonyBridgeBundle::class => ['all' => true],

Without a recipe, Flex registers the bundle class it finds under the name `<Vendor><Package>Bundle`
(`BrefSymfonyBridgeBundle`), whatever the package type, and ignores `extra.symfony.bundles`.
`BrefBundle` was never registered, so the CloudWatch log formatter was never enabled on new
applications. `BrefBundle` stays as a deprecated alias for applications that registered it.

Claude-Session: https://claude.ai/code/session_0168N55uBK9UjfpL6r8oGjDm
@mnapoli mnapoli changed the title Let Symfony Flex register the bundle Fix Symfony Flex not registering the bundle Sep 26, 2026
@mnapoli
mnapoli merged commit a712a1d into master Sep 26, 2026
10 checks passed
@mnapoli
mnapoli deleted the flex-registers-bundle branch September 26, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant