The cache

blaze provides a simple way to temporarily store values. blaze will create a folder 'cache' which will hold several things. If you delete this folder, also the cached keys/values will be deleted.

The caching component is available like this:

    $blaze->cache

Usage of the cache component is simple, there are two functions to use.

    $blaze->cache->set($key, $value);
    $blaze->cache->get($key);

The setter function takes two variables. One of them is $key, which can be any string. The other one is the value to store. $value could be a string, an integer value, a boolean value or both an associative array or a non associative array.

The getter function returns false if there is nothing stored for $key.

If you do want to know if a key/value combination is hold in the cache, you may use this helper function:

    $blaze->cache->has($key);

If $key is available in the cache, this function will return true, else it will return false.

To remove a stored value from cache, use this.

    $blaze->cache->remove($key);

You can also completely wipe the cache:

    $blaze->cache->wipe();

Storing file contents

blaze also provides a way to store more than simple key/value combinations. Please read the file storage documentation if you need this.