|
1 | 1 | # Hierarchical PSR-6 cache pool |
2 | | -[](https://travis-ci.org/php-cache/hierarchical-cache) [](https://codecov.io/github/php-cache/hierarchical-cache?branch=master) |
| 2 | +[](https://gitter.im/php-cache/cache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) |
| 3 | +[](https://packagist.org/packages/cache/hierarchical-cache) |
| 4 | +[](https://packagist.org/packages/cache/hierarchical-cache) |
| 5 | +[](https://packagist.org/packages/cache/hierarchical-cache) |
| 6 | +[](LICENSE) |
3 | 7 |
|
4 | 8 | This is a implementation for the PSR-6 for an hierarchical cache architecture. |
5 | 9 |
|
6 | 10 | If you have a cache key like `|users|:uid|followers|:fid|likes` where `:uid` and `:fid` are arbitrary integers. You |
7 | 11 | may flush all followers by flushing `|users|:uid|followers`. |
| 12 | + |
| 13 | +It is a part of the PHP Cache organisation. To read about features like tagging and hierarchy support please read |
| 14 | +the shared documentation at [www.php-cache.com](http://www.php-cache.com). |
| 15 | + |
| 16 | +### Install |
| 17 | + |
| 18 | +```bash |
| 19 | +composer require cache/hierarchical-cache |
| 20 | +``` |
8 | 21 |
|
9 | | -```php |
10 | | -$user = 4711; |
11 | | -for ($i = 0; $i < 100; $i++) { |
12 | | - $item = $pool->getItem(sprintf('|users|%d|followers|%d|likes', $user, $i)); |
13 | | - $item->set('Justin Bieber'); |
14 | | - $pool->save($item); |
15 | | -} |
| 22 | +### Use |
16 | 23 |
|
17 | | -$pool->hasItem('|users|4711|followers|12|likes'); // True |
| 24 | +Read the [documentation on usage](http://www.php-cache.com/en/latest/hierarchy/). |
18 | 25 |
|
19 | | -$pool->deleteItem('|users|4711|followers'); |
| 26 | +### Implement |
20 | 27 |
|
21 | | -$pool->hasItem('|users|4711|followers|12|likes'); // False |
22 | | -``` |
| 28 | +Read the [documentation on implementation](http://www.php-cache.com/en/latest/implementing-cache-pools/hierarchy/). |
| 29 | + |
| 30 | +### Contribute |
| 31 | + |
| 32 | +Contributions are very welcome! Send a pull request to the [main repository](https://github.com/php-cache/cache) or |
| 33 | +report any issues you find on the [issue tracker](http://issues.php-cache.com). |
23 | 34 |
|
24 | | -| Feature | Supported | |
25 | | -| ------- | --------- | |
26 | | -| Flush everything | Yes |
27 | | -| Expiration time | Yes |
28 | | -| Tagging | Yes |
|
0 commit comments