Download the PHP package slick/cache without Composer

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

Slick Cache package

Latest Version Build Status Coverage Status Quality Score Total Downloads

Slick cache package works with cache providing services installed on your system.

It comes with support for Memcached (memcached daemon) and File (caching data into files) out of the box, but it also defines a driver interface that allows you to add your own drivers to your project.

Install

Via Composer

Usage

To use a cache driver you simple need to call the Cache::get() static method to get an initialized cache driver. Check the following example:

In this example we are using the default cache driver with default options, to store some expensive API call data.

note

The default driver is Memcached with the following default options:

  • duration => 120
  • host => ‘127.0.0.1’
  • port => 11211

Changing cache expire time

The expire amount of time is always set when you set a value on the cache driver. As mention above, the default is set to 120 seconds. Using the above example, we will set the time expire amount to 3 minutes for the data from our fictitious API call:

It is also possible to define a global expire amount of time for all Cache::set() like this:

Slick\Cache\DriverInterface::set()

Set/stores a value with a given key. If no value is set in the expire parameter the default Cache::duration will be used.

Parameters Type Description
$key string The key where value will be stored
$value mixed The value to store
$expire int The live time of cache in seconds
Return Description
Slick\Cache\DriverInterface A DriverInterface instance for chaining method calls.

Slick\Cache\DriverInterface::get()

Retrieves a previously stored value. You can optionally set the value returned in case of cache driver has no value for provided key.

Parameters Type Description
$key string The key where value was stored
$default mixed The value returned if cache driver has no value for provided key
Return Description
mixed The stored value or the default value if cache driver has no value for provided key

Slick\Cache\DriverInterface::erase()

Erase the value stored with a given key. You can use the “?” and “" wildcards to delete all matching keys. The "?" means a place holders for one unknown character, the "” is a place holder for various

Parameters Type Description
$key string The key where value was stored
Return Description
Slick\Cache\DriverInterface A DriverInterface instance for chaining method calls.

warning

The use of “?” and “*” placeholder is only implemented in the drivers that are provided by Slick cache component. If you create your own cache driver you need to handle the placeholders key search implementation.

tip

If you are implementing your own cache driver and want to have the “?” and “*” placeholders search you can extend Slick\Cache\Driver\AbstractDriver witch uses the DriverInterface::get() and DriverInterface::set() methods to achieve the wildcards key search feature.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of cache with dependencies

PHP Build Version
Package Version
Requires slick/common Version @dev
league/flysystem Version ^1.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 slick/cache contains the following files

Loading the files please wait ....