small cleanup

This commit is contained in:
Grzegorz Surmann 2024-09-03 00:59:18 +02:00
parent e63d73953f
commit d350c4f6c6
2 changed files with 6 additions and 9 deletions

View File

@ -2,7 +2,7 @@
require_once("inc/Class.PHPCACHER.inc.php"); require_once("inc/Class.PHPCACHER.inc.php");
$cache = new Cache(); $cache = new PHPCACHER();
$cache->setPath("./cache"); $cache->setPath("./cache");
$cache->setTTL(3600); $cache->setTTL(3600);

View File

@ -1,6 +1,11 @@
<?php <?php
class PHPCACHER { class PHPCACHER {
function __construct() {
$this->setTTL(3600);
$this->setPath("./cache");
return TRUE;
}
public function put($item,$data) { public function put($item,$data) {
file_put_contents($this->fileName($item),serialize($data)); file_put_contents($this->fileName($item),serialize($data));
return TRUE; return TRUE;
@ -45,11 +50,3 @@ class PHPCACHER {
return TRUE; return TRUE;
} }
} }
class Cache extends PHPCACHER {
function __construct() {
$this->setTTL(3600);
$this->setPath("./cache");
return TRUE;
}
}