Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Sep 24, 2023
1 parent 23d2499 commit b574177
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: intl
tools: flex

- name: Validate composer.json and composer.lock
run: composer validate --strict
Expand Down
44 changes: 5 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,13 @@
# rekalogika/psr-16-simple-cache-bundle

Enables PSR-16 Simple Cache services in Symfony projects. These were previously
enabled in the older Symfony version but were removed in 4.3.

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

```bash
composer require rekalogika/psr-16-simple-cache-bundle
```

Usage
-----

Caller can simply wire in `Psr\SimpleCache\CacheInterface`. The service uses
the same underlying pool used by Symfony's `CacheInterface`.

```php
use Psr\SimpleCache\CacheInterface;

class SomeService
{
public function __construct(private CacheInterface $cache)
{
}

public function doSomething()
{
$this->cache->set('foo', 'bar');
}
}
```

Rationale
---------
## Documentation

We are using PSR-16 mostly as an expiring key-value storage. While PSR-6 and
Symfony's CacheInterface are more powerful and easier to use for caching things,
we don't feel their interfaces are suitable for a key-value storage. Other might
feel this is an abuse of a cache framework, but looking at [other
project](https://www.scrapbook.cash/), it seems others are doing the
same as we are doing.
[rekalogika.dev/psr-16-simple-cache-bundle](https://rekalogika.dev/psr-16-simple-cache-bundle)

Credits
-------
## Credits

This package is just a service definition. The actual implementation is done by
the Symfony project; they just don't make the service available by default.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "rekalogika/psr-16-simple-cache-bundle",
"description": "Enables PSR-16 Simple Cache services in Symfony that were previously removed in Symfony 4.3. Just wire in Psr\\SimpleCache\\CacheInterface to use it.",
"homepage": "https://rekalogika.dev/psr-16-simple-cache-bundle",
"keywords": [
"psr-16",
"simple-cache",
Expand Down

0 comments on commit b574177

Please sign in to comment.