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

A simple, dependency-free PHP library that adds tagging and namespacing on top of a small key/value cache backend (APCu by default). It provides a lightweight, easy-to-integrate TaggedCache for invalidating groups of cache entries by tag, plus a thin ApcCache adapter that uses APCu as the backing store.

Why use this library?

Quick status

Installation

Require the package via Composer:

(If you're developing locally, you can also clone the repo and include it with Composer using path repositories.)

Note: To use the included ApcCache you must have the APCu extension enabled (CLI and/or FPM depending on your environment). If APCu isn't available, implement the JoeFallon\PhpCache\Cacheable interface to plug in another backend (Redis, Memcached, filesystem, etc.).

Basic usage

This example shows the two main classes included in the package: ApcCache (back-end) and TaggedCache (feature layer).

Example — non-tagged value:

Example — tagged values and bulk invalidation:

Namespaces

TaggedCache supports a namespace string passed to its constructor. Namespacing is applied to all keys and tag lists, so you can safely use multiple independent caches in the same backing store:

Expiration (TTL)

Example (custom TTL):

Storage format (implementation note)

Entries saved by TaggedCache are stored in the underlying Cacheable using a small associative structure with the following keys:

This is internal implementation detail but useful to know if you inspect the backing store directly.

Public API (main methods)

Best practices and gotchas

Implementing a custom backend

If you can't or don't want to use APCu, implement the JoeFallon\PhpCache\Cacheable interface and pass your adapter into TaggedCache. The interface is intentionally small:

A custom adapter lets you use Redis, Memcached, or a filesystem-based cache.

Testing locally

The project now uses PHPUnit (v9.6) for unit tests. Run the test suite using the repository-installed PHPUnit binary:

Notes:

Troubleshooting

Contributing

Contributions are welcome. Some suggestions:

Please fork, open a feature branch, and submit a pull request. Keep changes small and include tests.

License

This project is licensed under the MIT license — see the LICENSE file for details.

Acknowledgements

Inspired by the need to tag and invalidate groups of cache entries when related data changes. If you find this useful, please star the repository and consider contributing improvements or adapters for other backends.

Contact / Support

If you need help integrating the library, open an issue with a minimal reproducible example and I'll take a look.


Built with ❤️ and the KISS principle.


All versions of phpcache with dependencies

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

Loading the files please wait ...