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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky