2022-11-14 PHP实现文件缓存 PHP实现文件缓存 Cache.class.php<?php class Cache { /** * 缓存目录 * @var */ private $cache_dir; /** * @param $cache_dir * @throws Exception */ public function __construct($cache_dir) { $this->cache_dir = $cache_dir; if (!is_dir($cache_dir)) { $make_dir_result = mkdir($cache_dir, 0755, true); if ($make_dir_result === false) throw new Exception('Cannot create the cache directory'); } } /** * 根据k... 2022年11月14日 941 阅读 0 评论