File storage

Sometimes, you may need to store more than a simple value or the result of a calculation. As the cache is not made for more than key/value storing, blaze holds a file storage for you.

You can provide a file content which should be stored, and which you can retrieve at a later point. Usage is dead simple, but keep in mind, that the storage does only take strings to store.

Available functions

There is a very simple set of functions to use the file storage.

    $blaze->storage->store($key, $content);

Both parameters for this function are mandatory, both must be strings. $content may hold an entire file's content.

    $blaze->storage->get($key);

This method will load a stored file content, returns false if there is nothing stored for $key.

Like the cache handler, the storage handler does provide a method to check if a key has a stored file content:

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

To remove a stored file content, use this method:

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

You can also delete all stored files using this method:

    $blaze->storage->wipe();