Download the PHP package webiny/cache without Composer

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

Cache Component

Cache component give you ability to store different information into memory for a limited time.

Install the component

The best way to install the component is using Composer.

For additional versions of the package, visit the Packagist page.

Supported drivers

The cache component supports following cache drivers:

If you are not sure which driver to use, we suggest Memcache.

Based on the selected driver, you'll have to pass different options to the constructor.

Requirements

The default bridged library is Memory by Jamm (https://github.com/jamm/Memory). It is required that you add this library to the ClassLoader :

For example:

Common operations

Once you have created your Cache instance, you can start using your cache. The cache methods are the same, no matter which driver you use:

Cache config

The preferred way of defining cache drivers is creating them inside your the config file of your application.

See the ExampleConfig.yaml for additional details.

Under Cache you define the cache drivers by giving each of them a cache id and underneath you nest its config. The driver configuration depends on which driver you are using.

If you wish to turn off the cache, use the BlackHole driver.

The Method parameter must be a valid callback function that will return an instance of CacheStorage.

The benefit of defining cache drivers in this way is that the drivers are initialized the second Webiny Framework is loaded. This enables you to access the cache by 'CacheTrait'.

Custom Cache driver

To implement you own custom cache driver you must first create a class that will implement \Webiny\Component\Cache\Bridge\CacheInterface. Once you have that class, create another class with a static function that will return an instance of CacheDriver.

Now just set your class and the static method as the Method inside your config and you can access the cache over the CacheTrait.

Resources

To run unit tests, you need to use the following command:

$ cd path/to/Webiny/Component/Cache/
$ composer.phar install
$ phpunit

Make sure that you also set your cache driver details in Tests/ExampleConfig.yaml.


All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version ^7
webiny/std-lib Version ~1.6
webiny/config Version ~1.6
webiny/service-manager Version ~1.6
webiny/forked-jamm-memory 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 webiny/cache contains the following files

Loading the files please wait ....