Download the PHP package slm/cache without Composer

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

SlmCache

Build Status Latest Stable Version

Version 0.1.0 Created by Jurian Sluiman

Requirements

Introduction

Installation

SlmCache works with Composer. To install it, just add the following line into your composer.json file:

Documentation

SlmCache works with a configured cache storage adapter and a list of routes which can be cached. Based on the request and the matched route SlmCache will fetch the response from the cache or not.

Configure cache storage

The cache can be configured in two ways. The first method uses the cache storage factory to instantiate a new cache instance. The second method let you point to a service in the service locator to fetch an existing cache service.

In below example, all configuration inside cache will be injected into the Zend\Cache\StorageFactory::factory() method. This enables you to configure the adapter, all adapter options and if needed, plugins.

In this example, the configuration is simply a string and points to a service. This enables you to have a single cache service in your application which can be used for other things than only SlmCache.

Configure cache prefix

Cache prefix is used to namespace cached data so it will not conflict with other modules. Ideally it should be unique.

In case you don't specify a cache_prefix, SlmCache will default to 'slmcache'.

Configure routes to be cached

The routes which can be cached must be configured in a single array. SlmCache will match the currently matched route name to this list of routes. If there is a match, the caching mechanism will be enabled. This allows you to have non-cached and cached routes inside a single application.

If the SlmCache is triggered, the cache will be used to fetch the response body. With short-circuiting the event system of Zend Framework 2, this result is directly returned to the browser. This will bypass the complete EVENT_DISPATCH part of the application execution. If there is no hit on the cache, SlmCache will wait until the application has finished rendering the complete response. This response is stored in the cache so next time a request takes place, the cache has a hit.

To configure a route to be cached, set it inside the routes array:

Match only routes for some HTTP methods

There is the possibility you have a route which is used for both GET and POST. You can configure SlmCache to only keep a cached version of the GET version and not cache the POST. Use the array to set the match_method:

You can also match multiple methods, if you need to:

Match only routes with specified route parameters

If you have a segment route where a part in the route sets the action, you might want to only cache a specific action. For the route foo[/:action] you might want to cache the match where action is bar but not for the action equals to baz. Use the match_route_params flag to configure this filtering:

You can have multiple actions you allow, but not all. The value can be an array of possible actions:


All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3.
zendframework/zendframework Version >=2.0.0,<2.3.0-dev
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 slm/cache contains the following files

Loading the files please wait ....