Phpredis provides four helper methods for sorting which do not actually map directly to Redis commands, but are instead all simplified ways to call SORT with various different options specified.
The methods in question are:
- sortAsc
- sortAscAlpha
- sortDesc
- sortDescAlpha
In going through the code and cleaning up some of the methods, I noticed that this creates quite a lot of code duplication, and everything that can be done with the above methods can also be done by calling sort directly.
In fact, until updating the code the helper methods could only handle a single GET pattern as it was taken as a string (redis supports multiple GET arguments).
I would like to deprecate the duplicated sort helper methods at some point in the near future. If this is problematic for people please comment here.
Mike
Phpredis provides four helper methods for sorting which do not actually map directly to Redis commands, but are instead all simplified ways to call
SORTwith various different options specified.The methods in question are:
In going through the code and cleaning up some of the methods, I noticed that this creates quite a lot of code duplication, and everything that can be done with the above methods can also be done by calling
sortdirectly.In fact, until updating the code the helper methods could only handle a single
GET patternas it was taken as a string (redis supports multiple GET arguments).I would like to deprecate the duplicated sort helper methods at some point in the near future. If this is problematic for people please comment here.
Mike