Closed vesan-lw closed 1 year ago
Hey, Thanks for opening the issue. Using instanceof isn't an option because of the nodejs runtime.
There are some places where the parent or implemented interfaces of a php class are determined using a regex, but this is currently not the case for the cache backend.
A custom cache backend is a rare use-case. I'll consider maybe adding support at some time. If you want to more quickly, please open a PR.
Hi Vinai,
Could it be a quick temporary fix like, for example, add condition - if no cache_dir but port is set then consider it's a redis cache but not files cache. What do you think? In the future is could be rebuilt to instanceof using php cli script which will take class name as parameter and check the instance of the class
sorry, closed accidentally, opening back
One more option could be: unuglify cache-clean.js so that it could be easily patched with an additional line to the "case" statement
You can make an unminified and unbundled build by running installing the build deps (clojure) and running make debug-build
no clear, we have regular composer package, how to make it unminified after composer install?
You can't unminify it, but you can create a new unminified build yourself.
You first need to install clojure.
Then you can make any required changes to the source code, and compile a new unminified build by running make debug-build
.
If you run make install-debug
it will create a debug-build and also install it in your local .composer/vendor/mage2tv/magento-cache-clean
directory.
The make commands have to be run in the git project, so if you use the composer package in vendor/mage2tv/magento-cache-clean
According to our CI/CD all packages need to be assembled by composer install
so it can't build debug version during deployment.
Could you check a small PR I've created?
I've tested the change and it works well. One small cosmetic change request, then I'll be happy to merge and tag a release!
Closed via #112
Released as 1.0.50 - thanks again!
Nice. Thank you!
The error: No cache_dir property present in file cache backend_options
How to reproduce: set custom cache backend setting in app/etc/env.php
The reason: hardcoded Magento\Framework\Cache\Backend\Redis in vendor/mage2tv/magento-cache-clean/bin/cache-clean.js file.
Custom class extends \Magento\Framework\Cache\Backend\Redis so that it could detected by instanceof.