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

Tool Cache Bundle Laravel Package

sfynx-project/tool-cache-bundle

A Symfony bundle for cache tooling that integrates with the framework’s cache system to help configure, manage, and inspect cache services. Streamlines caching setup and debugging in Symfony applications.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by assuming you will not be able to composer require this into a modern Laravel app. The bundle's constraints are Symfony 2.x/3.x-era (symfony/framework-bundle, symfony/dependency-injection, etc.), which will collide with the symfony/* ^6/^7 packages that Illuminate pulls in on Laravel 9+. The realistic onboarding path is:

  1. Read before you install. Clone pigroupe/SfynxCacheBundle and read, in this order:
    • DependencyInjection/Configuration.php — the authoritative list of adapters and options. Everything the bundle can do is declared here; the README is secondary and thinner.
    • Resources/config/*.xml — the service ids and constructor arguments. This tells you exactly which parameters (%kernel.cache_dir%, %kernel.root_dir%) you must fake in Laravel.
    • The Cache/ directory — the manager/handler classes you'll actually instantiate.
  2. Vendor the source, don't depend on it. Copy the src/ classes into app/Support/Cache/Sfynx/ (or a private path repository) and adjust namespaces. This sidesteps the abandoned dependency graph entirely and is the only sane option for a package last tagged in January 2017 with zero dependents.
  3. Register it yourself. There is no bundle register()/boot() in Laravel. Create a SfynxCacheServiceProvider that merges a config/sfynx_cache.php, constructs the cache manager by hand with an explicit adapter, and binds it as a singleton behind an interface you own.
  4. First use case: caching an expensive read — a dashboard aggregate query, a third-party API payload, or a rendered fragment — where you want tag-based invalidation rather than raw TTL expiry. That is the bundle's actual differentiator over Cache::put(): a manager that groups keys under tags so one flush clears a whole logical group.

Implementation Patterns

Wrap it, never call it directly. Define a small App\Contracts\CacheStore interface (get, put, has, forget, flushTags) and implement it with the Sfynx manager. Every call site depends on your interface, so the day the Sfynx code breaks on a PHP upgrade you swap the implementation for Illuminate\Contracts\Cache\Repository in one file.

Translate config, don't consume it. The bundle expects an array-shaped config tree keyed by cache name, each entry selecting an adapter by string id. Mirror that in config/sfynx_cache.php so it's env-aware, then pass the resolved array into the manager constructor inside your provider. Never let the bundle read %kernel.*% parameters — they don't exist in Laravel and will silently resolve to empty strings, dropping cache files into the project root.

Decorator/repository pattern for models. Cache per-entity reads with deterministic keys (user:{id}:v{schema_version}) and register saved/deleted model events to invalidate the matching tag (user:{id}). This is the pattern that makes tag support pay for itself: one $cache->flushTags("user:{$id}") in an observer clears profile, permissions, and preferences entries together.

Namespace your keys. If you point the bundle at the same Redis/Memcached instance Laravel uses, prefix everything (sfynx: or app:sfynx:) and use a separate Redis database where possible. The bundle's flush semantics are coarser than Laravel's store-scoped flush, and a stray flush() will take your sessions or queue cache with it.

Port the commands to Artisan. Anything the bundle exposed as a Symfony console command (cache clear/warm) belongs in app/Console/Commands with an explicit signature, e.g. cache:sfynx-flush --tag=. Don't try to boot the Symfony console kernel.

Warm-up job. For anything with tag invalidation, pair the invalidation event with a queued job that repopulates hot keys, otherwise you get a thundering herd on the first request after every write.

Gotchas and Tips

  • License: NOASSERTION. There is no declared license. That means default copyright applies — you have no grant to redistribute or use it commercially. Get sign-off before this touches a client codebase, or treat the source as reference material and reimplement the ~200 lines of tag bookkeeping yourself.
  • Abandoned since 2017-01-03. No dependents, one star, no issue triage. Expect PHP 8 fatals from removed functions and old Symfony signatures (EventDispatcherInterface, ContainerAware). Budget for a fork, not an integration.
  • Bundle ≠ package. The XML service definitions are the real API, and they wire in container parameters Laravel doesn't have. If you skip the manual provider and try to "just use the classes," you'll hit ParameterNotFoundException equivalents or, worse, silent nulls.
  • Adapter selection is string-based. A typo in the adapter name in config frequently falls through to a default rather than throwing. Log the resolved adapter class on boot during development — get_class($manager->getCache()) — and assert it matches what you configured.
  • APCu is disabled in CLI by default. If you test with an APCu-backed adapter, writes appear to no-op under php artisan and phpunit but work over HTTP. Set apc.enable_cli=1 in the CLI ini before concluding the bundle is broken.
  • Serialization surprises. Adapters that serialize() payloads will happily store an Eloquent model and hand back a stale, detached instance with no relations and a broken connection resolver. Cache arrays and scalars only; hydrate explicitly on read.
  • Filesystem adapter paths. The default cache directory derives from a kernel parameter. Hard-code an absolute path under storage/framework/cache/sfynx in your provider and verify permissions — a failed write is usually swallowed rather than raised.
  • No logging, no telemetry. Every adapter call is a black box. Wrap the implementation in a decorator that logs hit/miss and elapsed time in local/staging; without it you cannot tell a broken adapter from a cold cache.
  • Extension point worth knowing: the manager's adapter map is the one place designed for customization — register a custom adapter class there rather than editing bundle internals, so a future fork stays mergeable.
  • Cheapest exit: if all you need is tag-like invalidation, Illuminate\Support\Facades\Cache with RedisStore tags or a version-key prefix (cache_key = "v{n}:{key}", bump n to invalidate) gets you 90% of this bundle's value with none of the maintenance risk. Reserve the Sfynx code for cases where you specifically need its adapter matrix.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib