Download the PHP package romeoz/rock-cache without Composer

On this page you can find all versions of the php package romeoz/rock-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rock-cache

Cache library

Latest Stable Version Total Downloads Build Status Coverage Status License

What storages can be used:

All storage objects have one interface, so you can switch them without changing the working code.

Features

Table of Contents

Installation

From the Command Line:

or in your composer.json:

Quick Start

Memcached

MongoDB

Locking key

Race conditions can occur in multi-threaded mode. To avoid the effect, you need to install a lock on the key.

Documentation

get($key)

Returns value by key.

getMulti(array $keys)

Returns multiple values by keys.

set($key, mixed $value, $expire = 0, array $tags = null)

Sets a value to cache.

setMulti($key, mixed $value, $expire = 0, array $tags = null)

Sets a multiple key-values to cache.

add($key, mixed $value, $expire = 0, array $tags = null)

Adds a value to cache.

Return false, if already exists on the server.

exists($key)

Checks existence key.

touch($key, $expire = 0)

Changes expire (TTL) for key.

touchMulti(array $keys, $expire = 0)

Changes expire (TTL) for multiple keys .

increment($key, $offset = 1, $expire = 0, $create = true)

Increment a value to cache.

decrement($key, $offset = 1, $expire = 0, $create = true)

Decrement a value to cache.

remove($key)

Removes value from cache.

removeMulti(array $keys)

Removes multiple values from cache.

getTag($tag)

Returns a keys in accordance with tag.

getMultiTags(array $tags)

Returns a keys in accordance with multiple tags.

existsTag($tag)

Checks existence tag.

removeTag($tag)

Removes a tag.

removeMultiTag(array $tags)

Removes a multiple tags.

getAllKeys()

Returns all keys.

Supported: Memcached, Redis, APC.

getAll()

Returns all values.

Supported: Memcached, APC.

lock($key)

Sets a lock on the key.

unlock($key)

Unlocking key.

flush()

Removes all values from cache.

status()

Returns a status server.

Supported: Memcached, Memcache, Redis, APC, Couchbase.

getStorage()

Returns a native instance cache-storage.

Demo

Requirements

You can use each storage separately, requirements are individually for storages.

All unbolded dependencies is optional

There is a ready docker-container: docker run --name phpfpm_full -d romeoz/docker-phpfpm:5.6-full. But, it may be redundant for you because of the many of installed pecl-extensions

Storages comparison

Redis is the best key-value storage for cache. Use Couchbase if you need fault-tolerant and very easy scalable cluster and if you can afford it (recommended hardware requirements). Also, data in Redis and Couchbase storages will be restored even after server reboot.

Differences between the approaches a tagging

Grouping tags

Fastest method, but there is a possibility of overflow cache.

Set a value:

View in memory:

Removing tag:

View in memory:

Versioning tags

Is the best practice, but slower than the approach with the grouping tags, because when getting the cache containing tags, sent multiple requests to compare versions. There is no cache overflows.

References: nablas by D.Koterov (RUS) or "Reset group caches and tagging" by A.Smirnov (RUS).

Set a value:

View in memory:

Removing tag:

View in memory:

Returns value:

View in memory:

License

The Rock Cache library is open-sourced software licensed under the MIT license


All versions of rock-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
romeoz/rock-events Version 0.11.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package romeoz/rock-cache contains the following files

Loading the files please wait ....