mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:35:12 +00:00
35 lines
No EOL
785 B
PHP
35 lines
No EOL
785 B
PHP
<?php
|
|
|
|
namespace Code\Lib;
|
|
|
|
class ObjCache
|
|
{
|
|
public static function Get($path)
|
|
{
|
|
if (!$path) {
|
|
return '';
|
|
}
|
|
$localpath = Hashpath::path($path, 'cache/as', 2);
|
|
if (file_exists($localpath)) {
|
|
return file_get_contents($localpath);
|
|
}
|
|
return '';
|
|
}
|
|
public static function Set($path,$content) {
|
|
if (!$path) {
|
|
return;
|
|
}
|
|
$localpath = Hashpath::path($path, 'cache/as', 2);
|
|
file_put_contents($localpath, $content);
|
|
}
|
|
|
|
public static function Delete($path) {
|
|
if (!$path) {
|
|
return;
|
|
}
|
|
$localpath = Hashpath::path($path, 'cache/as', 2);
|
|
if (file_exists($localpath)) {
|
|
unlink($localpath);
|
|
}
|
|
}
|
|
} |