![]() |
Add new functions to Redis Handler - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Add new functions to Redis Handler (/showthread.php?tid=78670) |
Add new functions to Redis Handler - eelisland - 02-23-2021 What is the proper way to add thoses function to the Redis Handler whithout writing it in the System\Cache\Handlers\RedisHandler.php file ? PHP Code: public function getKeys( string $keys = "*" ) I read this from the Documentation here https://codeigniter4.github.io/userguide/extending/core_classes.html but i have to admit that i don't fully understand how it work. Can anyone describe me how i can do please ? RE: Add new functions to Redis Handler - tgix - 02-23-2021 (02-23-2021, 10:03 AM)eelisland Wrote: What is the proper way to add thoses function to the Redis Handler whithout writing it in the System\Cache\Handlers\RedisHandler.php file ? Rule #1: don't mess with framework files! I had to work around an issue in Redis handler by creating my own RedisHandler in app/Libraries: PHP Code: <?php In app/Config/Cache.php I added this to the array of validHandlers: PHP Code: public $validHandlers = [ Hope this helps! RE: Add new functions to Redis Handler - eelisland - 02-24-2021 Hello Tgix and Thank you, it works ! ![]() RE: Add new functions to Redis Handler - tgix - 02-24-2021 (02-24-2021, 02:11 AM)eelisland Wrote: Hello Tgix and Thank you, it works ! Glad to hear, Happy coding! |