Browse Source

Add support for mixed case commands

Commands in Redis are most time written in uppercase, Predis supports
only lowercase commands. This change converts all commands into lower-
case, so MiXeDcAsE and UPPERCASE commands can be created as well.
Jurian Sluiman 13 years ago
parent
commit
c33d053531
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/Predis/Profiles/ServerProfile.php

+ 2 - 0
lib/Predis/Profiles/ServerProfile.php

@@ -70,10 +70,12 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport {
     }
 
     public function supportsCommand($command) {
+        $command = strtolower($command);
         return isset($this->_registeredCommands[$command]);
     }
 
     public function createCommand($method, $arguments = array()) {
+        $method = strtolower($method);
         if (!isset($this->_registeredCommands[$method])) {
             throw new ClientException("'$method' is not a registered Redis command");
         }