apc('fetch', $key); } /** * Insert key * * @param string $key * @param mixed $var * @param int $time * @param mixed $compressed * * @return bool */ public function insert($key, $var, $time, $compressed) { return $this->apc('store', $key, $var, $time); } /** * Delete key * * @param string $key * * @return bool */ public function delete($key) { return $this->apc('delete', $key); } /** * Increment key * * @param string $key * @param int $increment = 1 * * @return int */ public function increment($key, $increment) { return $this->apc('inc', $key, $increment); } /** * Decrement key * * @param string $key * @param int $decrement = 1 * * @return int */ public function decrement($key, $decrement) { return $this->apc('dec', $key, $decrement); } /** * Clean all cache * * @param void * * @return bool */ public function clean() { return $this->apc('clear_cache'); } /** * Get info * * @param mixed $type * * @return array */ public function info($type = NULL) { return $this->apc('cache_info', $type) ?: []; } /** * Apc type * * @param string $type * @param mixed ...$args */ protected function apc(string $type, ...$args) { $method = $this->apc . '_' . $type; return $method(...$args); } }