Sfoglia il codice sorgente

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 anni fa
parent
commit
c33d053531
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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");
         }