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.
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:
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.Cache/ directory — the manager/handler classes you'll actually instantiate.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.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.Cache::put(): a manager that groups keys under tags so one flush clears a whole logical group.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.
EventDispatcherInterface, ContainerAware). Budget for a fork, not an integration.ParameterNotFoundException equivalents or, worse, silent nulls.get_class($manager->getCache()) — and assert it matches what you configured.php artisan and phpunit but work over HTTP. Set apc.enable_cli=1 in the CLI ini before concluding the bundle is broken.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.storage/framework/cache/sfynx in your provider and verify permissions — a failed write is usually swallowed rather than raised.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.How can I help you explore Laravel packages today?