@@ -844,10 +844,8 @@ protected function sendRawCommand($command, $params)
844
844
*/
845
845
private function parseResponse ($ params , $ command = null )
846
846
{
847
- $ prettyCommand = implode (' ' , $ params );
848
-
849
847
if (($ line = fgets ($ this ->socket )) === false ) {
850
- throw new SocketException ("Failed to read from socket. \nRedis command was: " . $ prettyCommand );
848
+ throw new SocketException ("Failed to read from socket. \nRedis command was: " . implode ( ' ' , $ params ) );
851
849
}
852
850
$ type = $ line [0 ];
853
851
$ line = mb_substr ($ line , 1 , -2 , '8bit ' );
@@ -864,7 +862,7 @@ private function parseResponse($params, $command = null)
864
862
return $ this ->redirect ($ line , $ command , $ params );
865
863
}
866
864
867
- throw new Exception ("Redis error: " . $ line . "\nRedis command was: " . $ prettyCommand );
865
+ throw new Exception ("Redis error: " . $ line . "\nRedis command was: " . implode ( ' ' , $ params ) );
868
866
case ': ' : // Integer reply
869
867
// no cast to int as it is in the range of a signed 64 bit integer
870
868
return $ line ;
@@ -876,7 +874,7 @@ private function parseResponse($params, $command = null)
876
874
$ data = '' ;
877
875
while ($ length > 0 ) {
878
876
if (($ block = fread ($ this ->socket , $ length )) === false ) {
879
- throw new SocketException ("Failed to read from socket. \nRedis command was: " . $ prettyCommand );
877
+ throw new SocketException ("Failed to read from socket. \nRedis command was: " . implode ( ' ' , $ params ) );
880
878
}
881
879
$ data .= $ block ;
882
880
$ length -= mb_strlen ($ block , '8bit ' );
@@ -892,7 +890,7 @@ private function parseResponse($params, $command = null)
892
890
893
891
return $ data ;
894
892
default :
895
- throw new Exception ('Received illegal data from redis: ' . $ line . "\nRedis command was: " . $ prettyCommand );
893
+ throw new Exception ('Received illegal data from redis: ' . $ line . "\nRedis command was: " . implode ( ' ' , $ params ) );
896
894
}
897
895
}
898
896
0 commit comments