https://github.com/b3none/php-cache
A super simple PHP caching layer.
https://github.com/b3none/php-cache
cache cache-storage php php-7 php7
Last synced: 17 days ago
JSON representation
A super simple PHP caching layer.
- Host: GitHub
- URL: https://github.com/b3none/php-cache
- Owner: B3none
- Created: 2018-07-17T21:04:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-04T14:03:23.000Z (almost 6 years ago)
- Last Synced: 2025-04-09T20:03:37.387Z (17 days ago)
- Topics: cache, cache-storage, php, php-7, php7
- Language: PHP
- Size: 4.88 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Cache
A super simple PHP caching layer.# Author
[B3none](https://b3none.co.uk/) - Developer / Maintainer# Installation
`composer require b3none/php-cache`# Example
The following is an extract from the [example.php](https://github.com/b3none/php-cache/blob/master/example.php)```php
// We can choose to specify the cache dir in the constructor.
$cacheClient = new \B3none\Cache\CacheClient('/tmp/B3none/cache');$cacheId = "b3none";
if ($cacheClient->hasCache($cacheId) && $cacheClient->isFreshEnough($cacheId, 5)) {
$cache = $cacheClient->getCache($cacheId);
print_r($cache);
} else {
$dataToCache = [
'b3none' => [
'github' => 'https://github.com/b3none',
'steam' => 'https://steamcommunity.com/b3none'
]
];
$cacheClient->setCache($cacheId, $dataToCache);
}
```