Explorar o código

Casting a instance of Predis\RedisServerProfile to string returns its associated version string.

Daniele Alessandri %!s(int64=15) %!d(string=hai) anos
pai
achega
9dae351819
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      lib/Predis.php

+ 4 - 0
lib/Predis.php

@@ -807,6 +807,10 @@ abstract class RedisServerProfile {
             $this->_registeredCommands[$aliases] = $command;
         }
     }
+
+    public function __toString() {
+        return $this->getVersion();
+    }
 }
 
 class RedisServer__V1_0 extends RedisServerProfile {