Weave 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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings