Jamm\Memory\APCObject::save PHP Method

save() public method

Save variable in memory storage
public save ( string $key, mixed $value, integer $ttl = 259200, array | string $tags = NULL ) : boolean
$key string
$value mixed
$ttl integer - time to live (store) in seconds
$tags array | string - array of tags for this key
return boolean
    public function save($key, $value, $ttl = 259200, $tags = NULL)
    {
        static $cleaned = false;
        if (!$cleaned) {
            $this->del_old_cached();
            $cleaned = true;
        }
        if (!apc_store($this->prefix . $key, $value, intval($ttl))) {
            $this->ReportError('apc can not store key', __LINE__);
            return false;
        }
        if (!empty($tags)) {
            $this->set_tags($key, $tags, $ttl);
        }
        return true;
    }