Download the PHP package ruvents/spiral-cache without Composer

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

Spiral cache

This package integrates PSR-6 and PSR-16 compatible cache implementations (mostly Symfony one) into Spiral application. As a bonus it provides convenient caching solution for HTTP responses.

Installation

psr/simple-cache is optional, you can only use PSR-6 compliant cache.

symfony/cache is optional, you can use any PSR-6 implementation of your choice.

Then add CacheBootloader to your App.php:

Configuration

Put the following code into file app/config/cache.php:

Default pool must be created in order for package to function properly.

Use

Manually

After configuration you should be able to inject created cache pool into your code by its name:

If symfony/cache is installed you can upgrade PSR-6 cache implementation to PSR-16 by specifying CacheInterface:

If symfony/cache is installed you can inject its implementation of cache:

If symfony/cache is installed you can inject tag-aware cache:

With #[Cached] attribute

You can use #[Cached] attribute to remove caching code from HTTP action. You'll need to install Ruvents\SpiralCache\CacheInterceptor in order to have this attribute recognized. See related documentation for installation details.

Here is an example on how to cache HTTP response for a given action:

Method's class name, method's name and request URI are all used to automatically generate cache key. To implement custom key generation logic specify key in attribute:

If you want to apply caching conditionally specify callable array in if key:

If symfony/cache is installed and TagAwareCacheInterface is used as controllerPool you can selectively clear groups of cache items by specifying tags:


All versions of spiral-cache with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/cache Version ^1.0
psr/http-message Version ^1.0.1
spiral/framework Version ^2.8
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 ruvents/spiral-cache contains the following files

Loading the files please wait ....