Beispiel #1
0
 public function del($key)
 {
     $cache_file = $this->get_cache_file_from_key($key);
     if (kernel::is_debug()) {
         debug::save('cache', 'filesys del: file -> ' . $cache_file);
     }
     return @unlink($cache_file);
 }
Beispiel #2
0
 public function remove($sid)
 {
     $record = $this->memcache->get($sid);
     if (kernel::is_debug()) {
         debug::save('session', 'memcache get: key -> ' . $sid . ', value -> ' . var_export($record, true));
     }
     if ($record === false) {
         return;
     }
     $role_id = $record['role_id'];
     $this->memcache->delete($sid);
     $role_id_online_count = $this->memcache->decrement($role_id, 1);
     $needs_delete = $role_id_online_count !== false && $role_id_online_count <= 0;
     if ($needs_delete) {
         $this->memcache->delete($role_id);
     }
     if (kernel::is_debug()) {
         debug::save('session', 'memcache del: key -> ' . $sid);
         debug::save('session', 'memcache decrement: key -> ' . $role_id);
         if ($needs_delete) {
             debug::save('session', 'memcache del: key -> ' . $role_id);
         }
     }
 }
Beispiel #3
0
 protected function execute($sql)
 {
     $result = $this->conn->query($sql);
     if (kernel::is_debug()) {
         debug::save('session', $sql);
     }
     if ($result === false) {
         throw new server_except("except: {$sql}");
     }
 }