Download the PHP package quick/cache without Composer

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

Quick Cache

A quick and easy to use PSR-2 driver based caching library that will cache simple key/value pairs or call methods and cache their results.

Build Status

Includes Drivers For

* APC driver doesn't support clearing class/method caches manually via .

Author

License

MIT License

Usage

First install it via composer by placing this in a composer.json file

{
    "require": {
        "quick/cache": "v1.0.0"
    }
}

and running composer.phar install

Now you can use it in your code by calling the class:

$cache = new Quick\Cache;

$cache->set('name', 'Jerel Unruh', $ttl = 3600); /* will expire in 3600 seconds */

$name = $cache->get('name');

$cache->forget('name');

Let it call your methods for you and handle the results:

// you can pass any config items in an array
$cache = new Quick\Cache(array('driver' => 'redis'));

// pass any arguments as an array
$cache->method($this->UserModel, 'getUsersByGroup', array('admin', 'desc'), 3600);

$cache->method('Project\Model\UserModel', 'getUsersByGroup');

// clear all the data cached for this class
$cache->clear('Project\Model\UserModel');

// or just this class + method
$cache->clear('Project\Model\UserModel', 'getUsersByGroup');

Flush all cached items for this driver. Don't use this in production as it's expensive. Use it when taking an app from staging to live or etc.

$cache = new Quick\Cache;

$cache->flush();

Configuration

All configuration details can be set in the config files in vendor/quick/cache/config. There is also a config class that allows you to set details programmatically. The only thing that cannot be changed with the config class is the driver. It must be set in the global config file or when instantiating the class;

$cache = new Quick\Cache(array('driver' => 'file'));

$config = $cache->config_instance();

$config->set('cache_path', 'project/cache/');

At the same time we can run another instance with different configurations

$redis_cache = new Quick\Cache(array('driver' => 'redis'));

$redis_config = $redis_cache->config_instance();

$redis_config->set_many(array(
    'redis_connection' => array(
        'host'     => '127.0.0.1',
        'port'     => 6379,
        ),
    'redis_prefix' => 'cache',
));

// if you set the connection details manually you must refresh the connection
$redis_cache->connect();

// Create an APC driver instance
$apc_cache = new Quick\Cache(array('driver' => 'apc'));

$apc_cache->set('name', 'Jerel Unruh', 3600);

Other methods

$cache_path = $config->get('cache_path');

$config_items = $config->get_all();

$config->load('custom_driver');

Testing

Quick Cache is unit tested using phpUnit. I use Guard to run my tests while I work, if you have it installed you can test like this:

cd ./vendor/quick/cache
guard

If not you can run them via phpUnit

cd ./vendor/quick/cache
phpunit

Do not run these tests on a production environment! It will FLUSH your database!

Errors

If Quick Cache encounters a serious error that it needs to tell you about (such as unwriteable directories) it will throw a QuickCacheException


All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
predis/predis Version v0.7.3
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 quick/cache contains the following files

Loading the files please wait ....