Skip to content

Cache_redis missing check on clean method #4426

@DONEILL-emp

Description

@DONEILL-emp

Description of the problem
Calling ee()->cache->clean(); when connected to the Redis driver causing a deprecated error.
Need to check for the del method as you do in the delete method
if (method_exists($this->_redis, 'del')) { // $this->_redis->del } else ...

How To Reproduce

  1. Set the 'cache_driver' to redis
  2. Call ee()->cache->clean();

Error Messages
The delete function is deprecated: system/ee/legacy/libraries/Cache/drivers/Cache_redis.php:100

Environment Details:

  • Version: 7.4.11
  • PHP Version 8.1
  • MySQL Version 8.0
  • OS: Linux
  • Web Server: nginx

Possible Solution
Use the same if check as other methods such as delete to ensure calling the del method and not the delete method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions