nguyenanhung / php-file-cache
Light, simple and standalone PHP in-file caching class
Installs: 6 810
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
README
Light, simple and standalone PHP in-file caching class
This library is fork code from https://github.com/Wruczek/PHP-File-Cache
as refactoring someone!
Advantages
- Light, standalone and simple
- All code in one file - no pointless drivers.
- Secure - every generated cache file have a php header with
die
, making direct access impossible even if someone knows the path, and your server is not configured properly - Well documented and tested
- Supports PHP 5.4 - 8.0
- Free under a GPL-3.0 license
Requirements and Installation
You need PHP 5.4+ for usage
Require with composer:
composer require nguyenanhung/php-file-cache
Usage
<?php require_once __DIR__ . '/vendor/autoload.php'; use nguyenanhung\PhpFileCache\PhpFileCache; $cache = new PhpFileCache(); $data = $cache->refreshIfExpired("simple-cache-test", function () { return date("H:i:s"); // return data to be cached }, 10); echo "Latest cache save: $data";
See examples for more
Support
If any question & request, please contact following information
From Vietnam with Love <3