Переглянути джерело

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 роки тому
батько
коміт
c33d053531
1 змінених файлів з 2 додано та 0 видалено
  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");
         }