added network specs request

This commit is contained in:
Luca Haid
2026-02-02 13:33:27 +01:00
parent f8e36a1d05
commit 3391c74586
4 changed files with 500 additions and 23 deletions

View File

@@ -235,10 +235,10 @@ class GenieACS {
return $result;
}
private function getCache($key) {
private function getCache($key, $ttl = 3300) {
$file = TEMP_DIR . "/RadiusCache/" . md5($key) . ".json";
if (file_exists($file)) {
if (filemtime($file) < (time() - 1800)) {
if (filemtime($file) < (time() - $ttl)) {
@unlink($file);
return null;
}
@@ -247,6 +247,14 @@ class GenieACS {
return null;
}
public function getCachePublic($key, $ttl = 3300) {
return $this->getCache($key, $ttl);
}
public function setCachePublic($key, $data) {
$this->setCache($key, $data);
}
private function setCache($key, $data) {
$dir = TEMP_DIR . "/RadiusCache/";
if (!is_dir($dir)) @mkdir($dir, 0777, true);