Download the PHP package joefallon/phpcache without Composer

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

Joe's PHP Cache

By Joe Fallon

Normally, cache entries are invalidated using one of three methods:

  1. The cache entry is explicitly removed via a call to a remove() method of some sort.
  2. The cache entry is removed due to time-based expiration.
  3. The cache entry is removed due to being ejected to make room for newer entries.

Unfortunately, this does not allow a whole group of cache entries to be removed because they are dependent on a common factor. For example, let's assume we have a blog and the blog has many posts. Additionally, let's assume that a list of all of the posts has been added to the cache. Let's set the cache key for the group of posts to all_posts. Additionally, let's add a tag to this cache entry called posts_table.

Then, let's say we cache a single post. Let's give it a key of post_id_45. Also, let's give it a tag of posts_table. So now we have all the posts as a cache entry and the post with an ID of 45 as a cache entry. If we delete the post with id of 45, then of course remove it from the cache. However, we should also delete by tag every cache entry with the tag posts_table. This will remove the list of all posts from the previous paragraph. There could be many cache entries that are dependent on the contents of the posts table not changing. Using one or more tags to clear groups of cache entries make cache management much easier and less prone to error.

Installation

The easiest way to install Joe's PHP Cache is with Composer. Create the following composer.json file and run the php composer.phar install command to install it.

TaggedCache Class

The TaggedCache class allows the usage of simple key/value cache as a cache back-end. In fact, any class that implements Cacheable can be used as a cache back-end for TaggedCache. Currently, only APC is implemented. However, it is super easy to add more and I look forward to pull requests.

In addition to tags, TaggedCache supports several additional features:

  1. The cache can be namespaced to allow more than one cache to be segregated within a back-end.
  2. A default expires time in seconds is available to allow more aggressive cache expiration than the back-end default expires time. This can be useful for data retrieved from external web services (e.g. feeds).
  3. Each cache entry can have a custom expires time.

Available Methods

Here is a list of methods available in TaggedCache:

Add and Retrieve a Value From the Cache

Here is an example of adding a plain non-tagged value to the tagged cache:

Add and Remove a Tagged Value From the Cache

Here is an example of adding a cache entry to the cache that has a tag associated with it and then deleting that cache entry by tag instead of by key:

NOTE: In the previous example, all entries that have the tag 'tag2' would be deleted.


All versions of phpcache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 joefallon/phpcache contains the following files

Loading the files please wait ....