Download the PHP package bravo3/cache without Composer

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

Cache Interface

This is a PHP 5.4 caching interface with implementations for common key/value storage engines.

PSR Proposal

The interfaces in this library abide by the current PSR-6 draft for caching interfaces. It should be known that should PHP-FIG adopt a PSR standard for caching interfaces, the interfaces in this library will be replaced with the PSR standard.

More info:

Subject To Change

The approach taken follows the 'strong item' or 'repository model' as per the above meta documentation. Should the PSR standard pass, there will be minimal change. Should an alternative approach pass, much of this library - and any implementations based on the interfaces - will need to be refactored.

A new major version number will be applied to this library when PSR-6 passes.

Usage

Basic usage:

$pool = new RedisCachePool('tcp://10.0.0.1:6379');
$item = $pool->get('foo');

$item->get();       // Pull the value from the database
$item->isHit();     // Check if the retrieval was a cache hit

$item->exists();    // Check if the entry exists in the datbase (MAY avoid actually retrieving the value)

$item->set('bar');  // Save to cache
$item->delete();    // Remove from cache

$items = $pool->getItems(['test1', 'test2', 'test3']);  // Get a collection of items

Using a TTL can be done with a \DateTime object or a integer offset in seconds:

$item = $pool->getItem('foo');

$dt = new \DateTime();
$dt->modify('+10 seconds');

$item->set('bar', $dt);   // Set TTL with a \DateTime object
$item->set('bar', null);  // Clear the TTL, item never expires
$item->set('bar', 10);    // Set the TTL to 10 seconds

Implementations

Ephemeral

The ephemeral implementation is a single-session storage that loses it's data when the session ends. This is useful for testing or a default implementation in lack of a real cache storage device. Or if you just really don't care about the volatility of your data.

Redis

Redis support is fully integrated via the Predis library.

To enable Redis support:

composer require predis/predis

Bravo3/ORM

You can use any Bravo3/ORM driver to connect a cache connection, this is useful to maintain a single source to your database.

To enable ORM support:

composer require bravo3/orm

All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
psr/log Version ~1.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 bravo3/cache contains the following files

Loading the files please wait ....