forgot that php isn't python

This commit is contained in:
Shish
2019-05-28 15:16:22 +01:00
parent 4b4ff68729
commit 189385ff61
4 changed files with 5 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ class Cache {
public $hits=0, $misses=0;
public $time=0;
public function __construct($dsn: string) {
public function __construct(?string $dsn) {
$matches = array();
if($dsn && preg_match("#(.*)://(.*)#", $dsn, $matches)) {
if($matches[1] == "memcache") {
@@ -177,7 +177,7 @@ class Cache {
}
public function set(string $key, $val, int $time=0) {
$this->engine->set($key, $time, $val);
$this->engine->set($key, $val, $time);
if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) {
file_put_contents("data/cache.log", "Cache set: $key ($time)\n", FILE_APPEND);
}