The Cache component provides an extended PSR-6 implementation for adding cache to your applications.

Overview

Symfony PSR-6 implementation for caching

The Cache component provides an extended PSR-6 implementation for adding cache to your applications. It is designed to have a low overhead so that caching is fastest. It ships with a few caching adapters for the most widespread and suited to caching backends. It also provides a doctrine/cache proxy adapter to cover more advanced caching needs and a proxy adapter for greater interoperability between PSR-6 implementations.

Resources

Comments
  • Setting an expiry on SETS too

    Setting an expiry on SETS too

    As stated in the code, the RedisTagAwareAdapter requires Eviction policies to be either volatile-ttl, volatile-lru or volatile-lfu. However, in order for volatile eviction methods to work, the records MUST have an expiry

    However, for whatever reason an expiry on Sets are missing. It is only set on strings. I guess it was just forgotten

    opened by vidarl 4
  • Default lifetime issue

    Default lifetime issue

    [cache component] DefaultLifetime for FilesystemAdapter, ApcuAdapter and ArrayAdapter wasn't working properly.

    When It's used one of the specified Adapters with a defaultLifetime != 0, cacheItem doesn't expire at anytime.

    Tests have been added to check this and code to fix it.

    opened by ecanovas 3
  • Bug fix for socket connection to a server with a specified port

    Bug fix for socket connection to a server with a specified port

    In the commit was done follow changes in Traits/RedisTrait.php(188)

    Old code:

    $port = $hosts[0]['port'] ?? null;

    New code:

    $port = $hosts[0]['port'] ?? 6379;

    With DSN "redis:///var/run/redis/redis.sock" raise an error:

    Redis connection "redis:///var/run/redis/redis.sock?dbindex=5" failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
    

    Because phpredis doesn't allow socket connections with a port

    (new Redis)->connect('/var/run/redis/redis.sock', 6379);
    

    Error

    PHP Warning:  Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /root/test_redis.php on line 5
    PHP Fatal error:  Uncaught RedisException: php_network_getaddresses: getaddrinfo failed: Name or service not known in /root/test_redis.php:5
    Stack trace:
    #0 /root/test_redis.php(5): Redis->connect()
    #1 {main}
      thrown in /root/test_redis.php on line 5
    

    I added additional validation of connection type (by host or socket). I fixed condition when RedisSentinel connection call as it support connections by host only.

    opened by alebedev80 1
  • phpredis: Added full TLS support for RedisCluster

    phpredis: Added full TLS support for RedisCluster

    This Pr bridges the gap for full TLS support when using phpredis driver implementation of TLS.

    Adds the 'ssl' options array for cache configuration when using RedisCluster

    Switches directed node commands from using individual \Redis connections to using the recommended implementation from the phpredis documentation: https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#directed-node-commands

    opened by jackthomasatl 1
  • Add server-commands support for Predis AggregateConnections

    Add server-commands support for Predis AggregateConnections

    Fixes issue https://github.com/symfony/symfony/issues/35867

    PhpRedis and Predis do not have the same interface, so have to check which implementation is used. Furthermore, the getClientFor('master') works only for replicated redis instances.

    opened by DemigodCode 1
  • Connect to RedisCluster with password auth

    Connect to RedisCluster with password auth

    Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example) https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails

    RedisAdapter::createConnection(
        'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'
    );
    
    opened by mforbak 1
  • Connect to RedisCluster with password auth

    Connect to RedisCluster with password auth

    Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example) https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails

    RedisAdapter::createConnection(
        'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'
    );
    

    See RedisCluster usage here https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#declaring-a-cluster-with-an-array-of-seeds

    opened by mforbak 1
  • Fixed Redis Sentinel usage when only one Sentinel specified

    Fixed Redis Sentinel usage when only one Sentinel specified

    Fixes #33796 in symfony/symfony

    Added check for $params['redis_sentinel'] to line 274 of RedisTrait.php, as with a single Sentinel host (as you might in a test environment) the previous behaviour of converting the array of hosts to a single host configuration caused the class to initialise incorrectly and throw an error when later calling methods specific to the Sentinel interface.

    opened by Rohaq 1
  • Always pass $key to NullAdapter->createCacheItem

    Always pass $key to NullAdapter->createCacheItem

    Previously, if this were called, it would throw an ArgumentCountError. I'm assuming existing code always checks hasItem, so this bug hasn't impacted many people. This was noticed via static analysis.

    opened by TysonAndre 1
Releases(v6.2.4)
  • v6.2.4(Dec 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.2.3...v6.2.4)

    • bug #48823 Fix possibly null value passed to preg_match() in RedisTrait (chalasr)
    • bug #48816 Fix for RedisAdapter without auth parameter (rikvdh)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.10(Dec 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.1.9...v6.1.10)

    • bug #48823 Fix possibly null value passed to preg_match() in RedisTrait (chalasr)
    • bug #48816 Fix for RedisAdapter without auth parameter (rikvdh)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.18(Dec 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.0.17...v6.0.18)

    • bug #48823 Fix possibly null value passed to preg_match() in RedisTrait (chalasr)
    • bug #48816 Fix for RedisAdapter without auth parameter (rikvdh)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.18(Dec 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v5.4.17...v5.4.18)

    • bug #48823 Fix possibly null value passed to preg_match() in RedisTrait (chalasr)
    • bug #48816 Fix for RedisAdapter without auth parameter (rikvdh)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.3(Dec 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.2.2...v6.2.3)

    • bug #48711 RedisTrait::createConnection does not pass auth value from redis sentinel cluster DSN (evgkord)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.9(Dec 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.1.8...v6.1.9)

    • bug #48711 RedisTrait::createConnection does not pass auth value from redis sentinel cluster DSN (evgkord)
    • bug #47979 Fix dealing with ext-redis' multi/exec returning a bool (João Nogueira)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.17(Dec 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.0.16...v6.0.17)

    • bug #48711 RedisTrait::createConnection does not pass auth value from redis sentinel cluster DSN (evgkord)
    • bug #47979 Fix dealing with ext-redis' multi/exec returning a bool (João Nogueira)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.17(Dec 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v5.4.16...v5.4.17)

    • bug #48711 RedisTrait::createConnection does not pass auth value from redis sentinel cluster DSN (evgkord)
    • bug #47979 Fix dealing with ext-redis' multi/exec returning a bool (João Nogueira)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.2(Dec 16, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.2.1...v6.2.2)

    • bug #48680 fix lazyness of redis when using RedisTagAwareAdapter (nicolas-grekas)
    • bug #47979 Fix dealing with ext-redis' multi/exec returning a bool (João Nogueira)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0(Nov 30, 2022)

  • v6.1.8(Nov 28, 2022)

  • v6.0.16(Nov 28, 2022)

  • v6.2.0-RC1(Nov 25, 2022)

  • v6.2.0-BETA3(Nov 19, 2022)

  • v6.2.0-BETA2(Oct 28, 2022)

  • v6.1.7(Oct 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.1.6...v6.1.7)

    • bug #47884 Reserve numeric keys when doing memory leak prevention (simoheinonen)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.15(Oct 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.0.14...v6.0.15)

    • bug #47884 Reserve numeric keys when doing memory leak prevention (simoheinonen)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.15(Oct 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v5.4.14...v5.4.15)

    • bug #47884 Reserve numeric keys when doing memory leak prevention (simoheinonen)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.48(Oct 28, 2022)

    Changelog (https://github.com/symfony/cache/compare/v4.4.47...v4.4.48)

    • bug #47884 Reserve numeric keys when doing memory leak prevention (simoheinonen)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0-BETA1(Oct 24, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.1.6...v6.2.0-BETA1)

    • feature #47730 Ban DateTime from the codebase (WebMamba)
    • feature #46806 Add adapter class to Cache DataCollector (Jean-Beru)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.5(Sep 30, 2022)

  • v6.0.13(Sep 30, 2022)

  • v5.4.13(Sep 30, 2022)

  • v4.4.46(Sep 30, 2022)

  • v6.1.3(Jul 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.1.2...v6.1.3)

    • bug #47003 Ensured that redis adapter can use multiple redis sentinel hosts (warslett)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.11(Jul 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.0.10...v6.0.11)

    • bug #47003 Ensured that redis adapter can use multiple redis sentinel hosts (warslett)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.11(Jul 29, 2022)

    Changelog (https://github.com/symfony/cache/compare/v5.4.10...v5.4.11)

    • bug #47003 Ensured that redis adapter can use multiple redis sentinel hosts (warslett)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.44(Jul 29, 2022)

  • v6.1.2(Jun 26, 2022)

  • v6.0.10(Jun 26, 2022)

    Changelog (https://github.com/symfony/cache/compare/v6.0.9...v6.0.10)

    • bug #46699 Respect $save option in all adapters (jrjohnson)
    • bug #46543 do not pass null to strlen() (xabbuh)
    Source code(tar.gz)
    Source code(zip)
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

Minibase 16 Jun 7, 2022
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

Minibase 16 Jun 7, 2022
QuidPHP/Main is a PHP library that provides a set of base objects and collections that can be extended to build something more specific.

QuidPHP/Main is a PHP library that provides a set of base objects and collections that can be extended to build something more specific. It is part of the QuidPHP package and can also be used standalone.

QuidPHP 4 Jul 2, 2022
Testing utilities for the psr/log package that backs the PSR-3 specification.

FIG - Log Test Testing utilities for the psr/log package that backs the PSR-3 specification. Psr\Log\Test\LoggerInterfaceTest provides a base test cla

PHP-FIG 3 Nov 19, 2022
Library download currency rate and save in database, It's designed to be extended by any available data source.

Library download currency rate and save in database, It's designed to be extended by any available data source.

Flexmind. Krzysztof Bielecki 2 Oct 6, 2021
Converts any PocketMine-MP 3.0 extended blocks into PM4 native blocks!

ExtendedBlocksConverter Converts any PocketMine-MP 3.0 extended blocks into PM4 native blocks! Yes, you heard right, this plugin can convert any lefto

Covered123 6 Jun 4, 2022
Extended translation module

Multi-lingual Support Extending Phalcon Framework v5 Translations Module Example e.g. login.json File: { "form": { "label": {

someson 5 Dec 31, 2022
A package for adding more type safety to your PHP projects.

Table of Contents Overview Installation Usage Simple Checks Advanced Checks Custom Checks Skipping Checks Testing Security Contribution Credits Change

Ash Allen 14 Aug 31, 2022
Adding Firebase PHP to your project using Composer

Firebase PHP Client ❤️ Sponsor Based on the Firebase REST API. Available on Packagist. Adding Firebase PHP to your project using Composer For PHP 7 or

Tamas Kalman 786 Dec 31, 2022
A simple implementation of the api-problem specification. Includes PSR-15 support.

ApiProblem This library provides a simple and straightforward implementation of the IETF Problem Details for HTTP APIs, RFC 7807. RFC 7807 is a simple

Larry Garfield 236 Dec 21, 2022
This is an implementation of PSR specification. It allows you to send and consume message with Redis store as a broker.

This is an implementation of PSR specification. It allows you to send and consume message with Redis store as a broker.

Enqueue 35 Nov 4, 2022
Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation.

Envbar Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation. This should help backend users

Magenizr 6 Oct 7, 2022
A library for adding economic concepts.

PHP use binary version 8.0.10 use PocketMine-MP version API4-beta11+dev2067 Init use oiran\walletlib\api\WalletLib; use oiran\walletlib\api\WarningLev

null 12 Jan 30, 2022
A library for adding economic concepts.

Summary This plugin adds the concept of money to the server. Wallet data held by the player is stored in .json format and I/O asynchronously. As for t

null 12 Jan 30, 2022
Adds support for quickly adding a "snow day" banner at the top of a website.

❄️ Snow Day Plugin ?? Requires OctoberCMS 2.0 ✨ What does this plugin do? Provides the ability to quickly add a cross-site banner using a component. ❓

Albright Labs 4 Nov 7, 2022
This AddOn allows you to search for module names when adding a block

Modulsuche und Modulvorschau für REDAXO 5 Dieses AddOn ermöglicht die Suche nach Modulnamen, wenn man einen Block hinzufügt. Dies kann sehr hilfreich

Friends Of REDAXO 15 Nov 30, 2022
An extension for PHPStan for adding analysis for PHP Language Extensions.

PHPStan PHP Language Extensions (currently in BETA) This is an extension for PHPStan for adding analysis for PHP Language Extensions. Language feature

Dave Liddament 9 Nov 30, 2022
Rah cache minify - HTML compressor module for rah cache Textpattern CMS plugin

Minify module for rah_cache This is a minify module for rah_cache, a full-page caching solution for Textpattern CMS. Rah_cache_minify will minify HTML

Jukka Svahn 1 Feb 13, 2014
Rah cache - Cache Textpattern's dynamic pages as flat files

rah_cache Packagist | Issues Rah_cache is a simple, experimental full-page caching plugin for Textpattern CMS. It caches Texpattern’s dynamic pages as

Jukka Svahn 2 Apr 24, 2022