PHPackages                             phpnomad/symfony-cache-integration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. phpnomad/symfony-cache-integration

ActiveLibrary[Caching](/categories/caching)

phpnomad/symfony-cache-integration
==================================

1.0.0(1y ago)024[1 PRs](https://github.com/phpnomad/symfony-cache-integration/pulls)1MITPHPCI failing

Since Dec 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phpnomad/symfony-cache-integration)[ Packagist](https://packagist.org/packages/phpnomad/symfony-cache-integration)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-symfony-cache-integration/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (4)Used By (1)

phpnomad/symfony-cache-integration
==================================

[](#phpnomadsymfony-cache-integration)

[![Latest Version](https://camo.githubusercontent.com/f0eed55ab8d4f254324c6b890de7062e32a60189c1cd1a9a2f38799e7680d7f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f73796d666f6e792d63616368652d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-cache-integration)[![Total Downloads](https://camo.githubusercontent.com/fd6869b716668dd9e7bf3e32a91762cb89187317caf1ea137566c83d459d6a1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f73796d666f6e792d63616368652d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-cache-integration)[![PHP Version](https://camo.githubusercontent.com/87b1cf602c37d3722d6b62e466420b4fc29b727a82b25521807cbcaf6b00ac5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f73796d666f6e792d63616368652d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-cache-integration)[![License](https://camo.githubusercontent.com/ca18e9c54b7625040534e6df60a757999b2c9556b12a9df6d1ce189a53ef82fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f73796d666f6e792d63616368652d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-cache-integration)

`phpnomad/symfony-cache-integration` adapts Symfony's Cache component to `phpnomad/cache`'s `CacheStrategy` contract. It ships a single strategy, `SymfonyFileCache`, backed by Symfony's `FilesystemAdapter`. Your application code still depends only on the `CacheStrategy` interface, so the Symfony-specific wiring stays at the bootstrap layer and never leaks into the services that read and write cached values.

Installation
------------

[](#installation)

```
composer require phpnomad/symfony-cache-integration
```

What This Provides
------------------

[](#what-this-provides)

- `SymfonyFileCache`, a `CacheStrategy` implementation backed by Symfony's `FilesystemAdapter`. It gives you a filesystem-backed persistent cache that satisfies the `phpnomad/cache` contract (`get`, `set`, `delete`, `exists`, `clear`) and throws `CachedItemNotFoundException` on a miss, so consumers can catch the exception and fall back to their source of truth.

Requirements
------------

[](#requirements)

- [`phpnomad/cache`](https://packagist.org/packages/phpnomad/cache) for the `CacheStrategy` interface and the `CachedItemNotFoundException` this package throws
- [`symfony/cache`](https://packagist.org/packages/symfony/cache) `^7.1`, the Symfony Cache component this package wraps
- PHP 8.2 or newer, inherited from `symfony/cache` `^7.1`

Usage
-----

[](#usage)

Register `SymfonyFileCache` as the concrete implementation of `CacheStrategy` in one of your application's initializers. The container then resolves any service that type-hints `CacheStrategy` to the filesystem-backed adapter.

```
