first commit

This commit is contained in:
Konstantin
2026-05-30 09:27:58 +03:00
commit de0344d218
2371 changed files with 661486 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Cache;
class Mem {
private $expire;
private $memcache;
const CACHEDUMP_LIMIT = 9999;
public function __construct($expire) {
$this->expire = $expire;
$this->memcache = new \Memcache();
$this->memcache->pconnect(CACHE_HOSTNAME, CACHE_PORT);
}
public function get($key) {
return $this->memcache->get(CACHE_PREFIX . $key);
}
public function set($key, $value) {
return $this->memcache->set(CACHE_PREFIX . $key, $value, MEMCACHE_COMPRESSED, $this->expire);
}
public function delete($key) {
$this->memcache->delete(CACHE_PREFIX . $key);
}
}