for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kemist\Cache\Storage;
/**
* ApcStorage
*
* @package Kemist\Cache
* @version 1.0.10
*/
class ApcStorage extends AbstractStorage implements StorageInterface {
* Constructor
* @param array $options
public function __construct(ApcObject $apc, array $options = array()) {
$this->prefix = (isset($options['prefix']) ? $options['prefix'] : '');
$this->provider = $apc;
}
* Initialise Cache storage
* @return boolean
* @throws \Kemist\Cache\Exception
public function init() {
return true;
* Checks if the specified name in cache exists
* @param string $name cache name
* @return bool
public function has($name) {
if ($this->provider->get($this->prefix . $name)) {
return false;
* Saves the variable to the $name cache
* @param mixed $val variable to be stored
public function store($name, $val, $compressed = false) {
$success = $this->provider->store($this->prefix . $name, $val);
$success ? $this->storeName($name) : null;
return $success;