Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Contentful Bundle Laravel Package

contentful/contentful-bundle

View on GitHub
Deep Wiki
Context7

ADR-0004: ProfilerController Registered Conditionally via Compiler Pass

Status

Accepted

Context

The bundle provides a ProfilerController that renders detailed Contentful API call info in the Symfony Web Profiler. However:

  • The profiler is only available in dev environment
  • Twig is not a required runtime dependency of the bundle (it's optional)
  • Registering ProfilerController unconditionally would force a hard Twig runtime dependency and cause container build failures in prod or in apps without Twig

Decision

A ProfilerControllerPass (implementing CompilerPassInterface) checks at container compile time whether both the profiler and twig services are registered. Only if both are present does it add the contentful.profiler_controller service definition with the controller.service_arguments tag.

This is the idiomatic Symfony pattern for optional framework integrations (used by Doctrine, SwiftMailer, etc.).

Consequences

  • Twig remains a require-dev dependency (not require)
  • The profiler panel works automatically when Symfony's standard dev stack is present
  • In prod or Twig-less apps, the controller is simply absent — no runtime errors
  • Any code that references contentful.profiler_controller directly must be aware it may not exist in all environments
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
baks-dev/finances
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle