New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command 'iNCRBY' is not a registered Redis command error #372
Comments
Apparently the Turkish language just decided to make things weird here! Jokes aside, I would've never guessed such an issue when uppercasing strings with plain latin characters but I've just read about it here and well... you learn something new every day 😄 Not sure how to fix this right now but unfortunately |
@widlturk fix is actually just replace ReplaceProfile.php line 85 to:
@nrk is there a way that we can use our own Profiler implementing ProfileInterface ? |
So same issue happened to me also when I using Laravel (5.3) Cache. I have investigated the issue and codes both Laravel lib and Predis lib. Looks like Predis proxy commands to Redis. From Laravel (5.3) documents :
So my solution on Laravel (probably will be same on other framework platforms or native users) : use commands like in Redis documents with "case sensitive"
Note : Packages/Vendors using "lowercase" Redis commands and that cause same problem : Probably extending Class and redefine functions/methods may solve the issue. |
@baskan yes with Predis v1.x you can implement Predis\Profile\ProfileInterface, extend Predis\Profile\RedisProfile or extend one of its subclasses and then pass the instance of this class to the $profile = new \My\New\RedisProfile();
$client = new \Predis\Client($parameters, ['profile' => $profile]); Please note that in this specific case you are still going to have problems with other parts of the library where |
If you don't want to change code,
shell command also solves the problem. |
how about setting the locale to "C" or "en_US.utf8" and restoring it to the original before returning to the caller |
strtoupper function and different character sets in the problem PREDIS package
sample
setlocale(LC_ALL, 'tr_TR.utf8', 'tr_TR.utf8', 'tr_TR');
used in a project that brings problems
sample
if (isset($this->commands[$commandID = strtoupper($commandID)])) { return $this->commands[$commandID]; }
INCRBY = iNCRBY
I solved the problem by using mb_strtoupper instead strtoupper.
The text was updated successfully, but these errors were encountered: