streams/Code/Lib/ObjCache.php

35 lines
785 B
PHP
Raw Normal View History

2022-11-06 21:56:10 +00:00
<?php
namespace Code\Lib;
class ObjCache
{
public static function Get($path)
{
2022-11-18 21:44:43 +00:00
if (!$path) {
return '';
}
2022-11-06 21:56:10 +00:00
$localpath = Hashpath::path($path, 'cache/as', 2);
if (file_exists($localpath)) {
return file_get_contents($localpath);
}
return '';
}
public static function Set($path,$content) {
2022-11-18 21:44:43 +00:00
if (!$path) {
return;
}
2022-11-06 21:56:10 +00:00
$localpath = Hashpath::path($path, 'cache/as', 2);
file_put_contents($localpath, $content);
}
public static function Delete($path) {
2022-11-18 21:44:43 +00:00
if (!$path) {
return;
}
2022-11-06 21:56:10 +00:00
$localpath = Hashpath::path($path, 'cache/as', 2);
if (file_exists($localpath)) {
unlink($localpath);
}
}
}