Download the PHP package mikehaertl/flushable without Composer

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

Flushable

This dependency can be used to flush an item from the cache. It allows you to invalidate any cached item like a cached ActiveRecord, a DAO query result, a cached fragment or a cached page.

Usage

Import the class file

Either add this line on top of every class file where you want to use it:

or add ext.flushable.FlushableDependency right to the import section of your main.php configuration file.

How to use the dependency

When you create the dependency you have to provide a unique $id wich identifies your cached content.

Now you can use it for data, fragment or page caching.

If you want to cache some ActiveRecord or DAO result the $id is usually the primary key. In this case you should add the model name to avoid conflicts among different cached model classes:

How to flush a content from cache

Whenever you want to invalidate the cached data you can now call:

If you used the dependency for data caching and added a model name you must provide the same name again:

You could put this into the afterSave() method of your active record (change $id to $this->id) or just call it manually whenever you update the record.

You can also add an $expire parameter to the flushItem() call. It will specify how long the information about the change should be kept in the cache. So obviously this should be more than the longest time which you cache your content. The default is 3600.

How it works

Whenever an item is cached with this dependency it scans the cache for another key. This key is unique per cached item and composed from the two parameters you pass along to the constructor. This other cache value basically indicates 'The item has expired!'. So if no such key is found, the item in the cache is still valid.

With a call to flushItem() you will create such an expiration entry in the cache for the cached item. So when the dependency is evaluated the next time it will find something now and the cached content will no longer be seen as valid.

Changelog

Release 1.1.2 (IMPORTANT: This update requires to flush your cache!)

Release 1.1.1

Release 1.1.0

Release 1.0.1


All versions of flushable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0.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 mikehaertl/flushable contains the following files

Loading the files please wait ....