Download the PHP package rl404/simple-php-cache without Composer

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

Forked from the original one.

Simple PHP Cache

About

A light, simple but powerful PHP5 Cache Class which uses the filesystem for caching. Your feedback is always welcome.

Requirements

Introduction

Basically the caching class stores its data in files in the JSON format. These files will be created if you store data under a Cache name.

If you set a new Cache name with setCache(), a new cache file will be generated. The Cache will store all further data in the new file. The Setter method allows you to switch between the different Cache files.

Quick Start

Setup Cache class

It's not much trouble to setup the Cache. First create a writable directory cache/ and include the Cache class:

Now we've setup the Cache instance and can start caching!

You can also make use of the Method Chaining feature, introduced in PHP5. So you can do something like that:

Available methods

Setup the Cache

new Cache(<array>/<string>)

string gives you the basic setup. It's the name of your Cache (standard Cache name is 'default'):

new Cache('YOUR-CACHE-NAME');

array allows you to define multiple optional parameters:

new Cache(array(
  'name'      => 'YOUR-CACHE-NAME',
  'path'      => 'cache/',
  'extension' => '.cache'
));

If you don't define a Cache name with the constructor or the setCache() method, it'll be 'default'.

Store data

store($key, $data, <$expiration>)

To change data you can overwrite it by using the same key identifier. Beside the data, the Cache will also store a timestamp.

A sample Cache entry looks like this:

Retrieve data

retrieve($key, <$timestamp>)

Get particular cached data by its key. To retrieve the timestamp of a key, set the second parameter to true.

retrieveAll(<$meta>)

This allows you retrieve all the cached data at once. You get the meta data by setting the $meta argument to true.

Erase data

For erasing cached data are these three methods available:

Check cached data

isCached($key)

Check whether any data is associated with the given key. Returns true or false.

Set Cache name

setCache($name)

If you want to switch to another Cache or create a new one, then use this method to set a new Cache name.

Set Cache path

setCachePath($path)

The path to the Cache folder must end with a backslash: my_path_to_the_cache_folder/

Get Cache file path

getCacheDir()

The method returns the path to your current Cache file (the Cache name is always sh1 encoded):

Benchmarks

If you've done one, please let me know.

History

Upcoming: Simple Cache 2.0 Implementation of an internal "soft cache", hash-sum handling and the switch to serialization. Thanks @dariushha for his contribution!

Simple Cache 1.6 - 04/01/2014

Simple Cache 1.5 - 01/01/2014

Simple Cache 1.4 - 08/09/2013

Simple Cache 1.3 - 28/02/2013

Simple Cache 1.2 - 09/05/2012

Simple Cache 1.1 - 01/01/2012

Simple Cache 1.0 - 29/12/2011

Simple Cache 0.9 - 25/12/2011

Simple Cache 0.8 - 24/12/2011

Simple Cache 0.5 - 22/12/2011

Credits

Copyright (c) 2011-2013 - Programmed by Christian Metz / @cosenary Released under the BSD License.


All versions of simple-php-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
ext-curl Version *
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 rl404/simple-php-cache contains the following files

Loading the files please wait ....