Download the PHP package jmatosp/tumbleweed-cache without Composer

On this page you can find all versions of the php package jmatosp/tumbleweed-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 tumbleweed-cache

TumbleweedCache

Build Status Coverage Status Latest Stable Version

PHP Caching - PSR-6 implementation

This library provides Calling Libraries abstract cache services.

Implementations for well known cache infrastructure, clever cache using multi-level/failover cache and clustered like cache.

Drivers available: APCu, Redis, Files, Memcached, Memory, 2 Level Cache

All drivers where tested using PHPUnit and a great 3rd party testing suite for PSR-6

Install

composer require jmatosp/tumbleweed-cache

Usage

Simple to use, Tumbleweed Cache will try to use one of the available drivers APCu, Redis or Files

$cache = CacheFactory::make();
$item = $cache->getItem('my_key')
            ->set('value')
            ->expiresAfter(60);
$cache->save($item);
echo $cache->getItem('my_key')->get();
// will output "value"

or not using CacheFactory and instantiating APCu directly

$cache = new APCuCache();
$cache->getItem('hello')->set('value');
echo $cache->getItem('hello')->get();   // output: "value"

You can specify the cache implementation to use:

APCu

This driver supports both apc and apcu, works with HHVM (legacy), apcu only PHP7 and apc/apcu on PHP5.6

$cache = CacheFactory::make(CacheFactory::APCU);
$item = $cache->getItem('my_key')->set('value');
$cache->save($item);
echo $cache->getItem('my_key')->get();
// will output "value"

Redis

You can use the factory to create a Redis cache instance, factory will try to connect to default port on localhost, or you can provide a connection as in this example.

$redis = new Redis();
$redis->connect('127.0.0.1');
$cache = CacheFactory::make(CacheFactory::REDIS, $redis);
$item = $cache->getItem('my_key')->set('value');
$cache->save($item);
echo $cache->getItem('my_key)->get();
// will output "value"

Files

File base cache interface, fast and uses /tmp directory. Cache factory will check if TMP dir is writable and throw and exception if not.

$cache = CacheFactory::make(CacheFactory::FILE);
$item = $cache->getItem('my_key')->set('value');
$cache->save($item);
echo $cache->getItem('my_key)->get();
// will output "value"

Memcache

$memcached = new Memcached('my_app_ip');
$memcached->addServer('localhost', 11211);
$cache = CacheFactory::make(CacheFactory::MEMCACHED, $memcached);
$item = $cache->getItem('my_key')->set('value');
$cache->save($item);
echo $cache->getItem('my_key)->get();
// will output "value"

Two level

Two level cache aims to use 2 cache repositories, as failover with two remote caches or a combination of one local to with faster access like APCu and one remote typically Redis or Memcached. Also good to work as a failover cache in case of the first one fails. Sample using APCu as first level (faster) and Redis second level (fast)

$localCache = CacheFactory::make(CacheFactory::APCU);
$remoteCache = CacheFactory::make(CacheFactory::REDIS);
$megaCache = CacheFactory::make(CacheFactory::TWO_LEVEL, $localCache, $remoteCache);
$item = $cache->getItem('my_key')->set('value');
$cache->save($item);
echo $cache->getItem('my_key')->get();
// will output "value"

Cache Factory

Cache factory enables creation to different type of cache infrastructure with an easy interface.

It has a builtin auto-discovery that will try to find the fastest one available, to use the auto-discovery simply call the factory without parameters:

$cacheService = CacheFactory::make();

Auto-discovery will try to use cache infrastructure by this order: APCu, APC, File, Redis

PSR-6 Cache Interface

All cache item pool implementations use PSR-6 interfaces, for details please visit PHP-FIG PSR-6: Caching Interface

Running tests

To run all test including integration you need:

Optionally you can run on the provided Vagrant box:

vagrant up
vagrant ssh
cd /vagrant
composer install
vendor/bin/phpunit

All versions of tumbleweed-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6|>=7.0
psr/cache Version ~1.0.0
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 jmatosp/tumbleweed-cache contains the following files

Loading the files please wait ....