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-0003: PSR-6 Cache and PSR-3 Logger — Standards-Based Injection

Status

Accepted

Context

The Contentful PHP CDA SDK supports optional caching (PSR-6 CacheItemPoolInterface) and logging (PSR-3 LoggerInterface). The bundle must allow Symfony applications to wire their existing cache and logging infrastructure into the SDK clients without prescribing specific implementations.

Options considered:

  1. Hard-code Symfony cache/logger — tightest coupling, least flexible
  2. Accept service IDs as config strings — flexible, but string-typed, error-prone
  3. Accept PSR interface service IDs with a default to Symfony's autowired instances — idiomatic Symfony: leverage the container's PSR interface aliases

Decision

Configuration accepts service IDs (strings) for options.logger and options.cache.pool. At compile time, ContentfulExtension::configureDeliveryOptions() converts these strings to Reference objects pointing to the specified services. The defaults are Psr\Log\LoggerInterface and Psr\Cache\CacheItemPoolInterface — the standard container aliases that Symfony's MonologBundle and CacheBundle register automatically.

This means:

  • Zero config needed for cache/logger in most apps (Symfony auto-wires them)
  • Custom implementations are supported by specifying a different service ID
  • No Symfony-specific types leak into the CDA SDK

Consequences

  • Applications must have a PSR-6 cache pool registered under Psr\Cache\CacheItemPoolInterface to use the default; if absent and cache is configured, container compilation fails with a missing service error
  • The psr/log requirement was added in bundle 7.1.0 (previously implicit via contentful/contentful) to make the dependency explicit and allow psr/log v2/v3
  • Swapping implementations (e.g., Redis vs APCu cache pool) requires only a config change, not code changes
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