ardagedik / basic-cache
使用文件系统进行缓存的简单快捷的缓存类
v1.0.0
2017-12-08 09:39 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is not auto-updated.
Last update: 2024-09-29 04:20:22 UTC
README
使用文件系统进行缓存的简单快捷的缓存类
功能
- 压缩缓存文件的源代码
- 确定缓存文件的扩展名
- 使用MD5加密文件名
安装
composer require ardagedik/basic-cache
使用方法
<?php require_once('vendor/autoload.php'); use ArdaGedik\BasicCache; $cache = new BasicCache(); ?>
<?php $cache->start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Basic Cache Example</title> </head> <body> <h1>Hello World</h1> </body> </html> <?php $cache->end(); ?>
选项
// These options are assigned by default $cache = new BasicCache([ "path" => "cache/", "expire" => 60, "extension" => ".html" ]);
// Clear all cache files $cache->clear();
许可证
MIT