prismo-smartpro/cache
最新稳定版本:1.2
Composer 安装命令:
composer require prismo-smartpro/cache
包简介
System Cache Smart PRO Technology
README 文档
README
Cache System Smart PRO Technology
Installation
composer require prismo-smartpro/cache
Example of Use
<?php require "vendor/autoload.php"; use SmartPRO\Technology\CacheControl; /* * Folder where the cache will be saved * Cache file extension */ $cache = new CacheControl(__DIR__ . "/cache", "cache"); $cache->setType(CacheControl::SERIALIZE); /* * Creating a new cache * Expiry in minutes */ $cache->set("profile=john", [ "name" => "John Walker", "age" => 35, "email" => "john@walker.com" ], 30); /* * Checks if the cache exists, if it exists, return the cache, if it doesn't exist, create it using the function */ $withCallable = $cache->has("data", function () { return array( array("name" => "John Walker", "age" => 37), array("name" => "John Samuel", "age" => 17) ); }, 15); var_dump($withCallable); /* * Search for a cached file * If it doesn't exist, return null * If it has already expired, return null and delete the cache */ $data = $cache->get("profile=john"); /* * Delete cache */ $cache->delete("profile=john");
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-02-05