This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework

Related tags

Caching cache-bundle
Overview

PSR-6 Cache bundle

Latest Stable Version codecov.io Build Status Total Downloads Monthly Downloads Quality Score SensioLabsInsight Software License

This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework. It lets you cache your sessions, routes and Doctrine results and metadata. It also provides an integration with the debug toolbar. This bundle does not contain any pool implementation nor does it help you register cache pool services. You maybe interested in AdapterBundle which will help you configure and register PSR-6 cache pools as services.

This bundle is a part of the PHP Cache organisation. To read about features like tagging and hierarchy support please read the shared documentation at www.php-cache.com.

To Install

Run the following in your project root, assuming you have composer set up for your project

composer require cache/cache-bundle

Add the bundle to app/AppKernel.php

$bundles(
    // ...
    new Cache\CacheBundle\CacheBundle(),
    // ...
);

Read the documentation at www.php-cache.com/symfony/cache-bundle.

Contribute

Contributions are very welcome! Send a pull request or report any issues you find on the issue tracker.

Comments
  • Register CachePools to Clear command to clear all

    Register CachePools to Clear command to clear all

    Right now the CacheFlushCommand does not clear all providers. By also registering those to the command when building the application, the providers also will get cleared when calling

    bin/console cache:flush all
    

    This MR also outputs info about what cache types have been flushed:

    [dev@devint www]$ bin/console cache:flush
    Do you want to clear all cache? [N] Y
     // Clearing cache for built in type 'annotation"
     // Clearing cache for built in type 'doctrine"
     // Clearing cache for built in type 'serializer"
     // Clearing cache for built in type 'session"
     // Clearing cache for built in type 'router"
     // Clearing cache for built in type 'validation"
     // Clearing cache for provider 'cache.provider.chain"
     // Clearing cache for provider 'cache.provider.file"
     // Clearing cache for provider 'cache.provider.redis"
    
     // Clearing the cache for the dev environment with debug true
    
     [OK] Cache for the "dev" environment (debug=true) was successfully cleared.
    
    opened by rvanlaak 8
  • CacheFlushCommand was using features from PHP 5.6 but the lowest supp…

    CacheFlushCommand was using features from PHP 5.6 but the lowest supp…

    Hi guys,

    The lowest supported PHP version in composer.json is PHP 5.5 but CacheFlushCommand is using array constants which aren't supported until PHP 5.6.

    This PR adds a fix.

    opened by iainmckay 6
  • Support for simple cache

    Support for simple cache

    Introducing the support for cache proxies instead for messing around with different types of recording pools like we did.

    This will create a proxy file that extends the original pool. It is only used in development of course.

    opened by Nyholm 4
  • Adds an option to disable the data collector

    Adds an option to disable the data collector

    We need a way to disable the data collector as during development our app regularly runs out of memory because of how much data it collects. In our particular case we use a lot of annotations and doctrine is caching those in memcache. We end up running over our memory limit.

    We don't get much value from the data collector so the option to disable solves the problem for us.

    opened by iainmckay 4
  • Recording pool fix

    Recording pool fix

    This will fix the issue with the RecorderCachePool (used for Symfony data collection) implements TaggableCache. If the underlying cache implemnation (like apc cache) does not support tagging we have to decorate the implementation with TaggablePSR6PoolAdapter. But that causes trouble when using a ChainPool.

    This PR introduce a Factory that choose a RecordingPool that implements the same interfaces as the CachePool.

    opened by Nyholm 3
  • Make sure we always dealing with ta tagging cache pool

    Make sure we always dealing with ta tagging cache pool

    Please review this. Im not too sure this is a good solution. The problem occurs when we are using a pool that do not support tagging, say APC. In debug we put the APC pool in the recording pool because we want to use the WebToolbar. The recording pool is always a Taggable pool. That's why we get errors like this: https://github.com/php-cache/issues/issues/50

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Cache\Adapter\Apc\ApcCachePool'
    

    This solution makes sure we are always dealing with a Taggable pool.

    opened by Nyholm 3
  • Add cache for annotation, serializer and validation

    Add cache for annotation, serializer and validation

    Should the SymfonyValidatorBridge be in a separate package? Pros:

    • It can be resused
    • It is similar to the DoctrineCacheBridge

    Cons:

    • Nobody wants to reuse it
    • It is dead simple to write
    opened by Nyholm 3
  • Update CacheDataCollector.php

    Update CacheDataCollector.php

    add reset method, which implement Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface and solve deprication

    User Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "Cache\CacheBundle\DataCollector\CacheDataCollector".

    opened by panki3a 1
  • Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase

    Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase

    I use the PHPUnit\Framework\TestCase notation instead of PHPUnit_Framework_TestCase while extending our TestCases. This will help us migrate to PHPUnit 6, that no longer support snake case class names.

    PS: I won't apply this StyleCI changes. There are not related to this PR :sweat_smile:

    opened by carusogabriel 1
Releases(1.1.0)
A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache tagging and indexing.

Apix Cache, cache-tagging for PHP Apix Cache is a generic and thin cache wrapper with a PSR-6 interface to various caching backends and emphasising ca

Apix 111 Nov 26, 2022
PSR-6 cache implementation adapting a given PSR-16 instance

PSR-6 cache implementation adapting PSR-16 This package provides a PSR-6 cache instance when you only have a PSR-16 cache at hand. As PSR-6 is more fe

null 1 Oct 15, 2021
Symfony2 Bundle for Doctrine Cache

DoctrineCacheBundle Symfony Bundle for Doctrine Cache. Master: Master: Deprecation warning This bundle is abandoned and will no longer be updated. If

Doctrine 2.8k Dec 9, 2022
Simple cache abstraction layer implementing PSR-16

sabre/cache This repository is a simple abstraction layer for key-value caches. It implements PSR-16. If you need a super-simple way to support PSR-16

sabre.io 48 Sep 9, 2022
PSR-15 middleware with various cache utilities

middlewares/cache Middleware components with the following cache utilities: CachePrevention Expires Cache Requirements PHP >= 7.2 A PSR-7 http library

Middlewares 15 Oct 25, 2022
Distributed PSR-16 cache implementation for PHP 6 that uses browser cookies to store data

cookiecache Cache beyond the edge with cookies! This library provides a distributed PSR-16 compatible cache implementation for PHP 6 that uses browser

Colin O'Dell 8 Apr 19, 2022
Symfony Bundle for the Stash Caching Library

TedivmStashBundle The TedivmStashBundle integrates the Stash caching library into Symfony, providing a powerful abstraction for a range of caching eng

Tedious Developments 86 Aug 9, 2022
Zend Framework cache backend for MongoDB

Zend_Cache_Backend_Mongo Author: Anton Stöckl About Zend_Cache_Backend_Mongo is a Zend Framework Cache Backend for MongoDB. It supports tags and autoc

Anton Stöckl 12 Feb 19, 2020
The place to keep your cache.

Stash - A PHP Caching Library Stash makes it easy to speed up your code by caching the results of expensive functions or code. Certain actions, like d

Tedious Developments 944 Jan 4, 2023
Refresh items in your cache without data races.

Cache Refresh Refresh items in your cache without data races. use Illuminate\Support\Facades\Cache; use Illuminate\Support\Collection; use App\Models\

Laragear 3 Jul 24, 2022
Simple artisan command to debug your redis cache. Requires PHP 8.1 & Laravel 9

?? php artisan cache:debug Simple artisan command to debug your redis cache ?? Installation You can install the package via composer: composer require

Juan Pablo Barreto 19 Sep 18, 2022
A simple cache library. Implements different adapters that you can use and change easily by a manager or similar.

Desarolla2 Cache A simple cache library, implementing the PSR-16 standard using immutable objects. Caching is typically used throughout an applicatito

Daniel González 129 Nov 20, 2022
A simple cache library. Implements different adapters that you can use and change easily by a manager or similar.

Desarolla2 Cache A simple cache library, implementing the PSR-16 standard using immutable objects. Caching is typically used throughout an applicatito

Daniel González 129 Nov 20, 2022
PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APC(u), SQL and additional capabilities (e.g. transactions, stampede protection) built on top.

Donate/Support: Documentation: https://www.scrapbook.cash - API reference: https://docs.scrapbook.cash Table of contents Installation & usage Adapters

Matthias Mullie 295 Nov 28, 2022
Cache slam defense using a semaphore to prevent dogpile effect.

metaphore PHP cache slam defense using a semaphore to prevent dogpile effect (aka clobbering updates, stampending herd or Slashdot effect). Problem: t

Przemek Sobstel 102 Sep 28, 2022
:zap: Simple Cache Abstraction Layer for PHP

⚡ Simple Cache Class This is a simple Cache Abstraction Layer for PHP >= 7.0 that provides a simple interaction with your cache-server. You can define

Lars Moelleken 27 Dec 8, 2022
Doctrine Cache component

Doctrine Cache Cache component extracted from the Doctrine Common project. Documentation This library is deprecated and will no longer receive bug fix

Doctrine 7.6k Jan 3, 2023
LRU Cache implementation in PHP

PHP LRU Cache implementation Intro WTF is a LRU Cache? LRU stands for Least Recently Used. It's a type of cache that usually has a fixed capacity and

Rogério Vicente 61 Jun 23, 2022