@@ -573,9 +573,9 @@ discard block |
||
| 573 | 573 | if ($this->_socket !== false) { |
| 574 | 574 | return; |
| 575 | 575 | } |
| 576 | - $connection = ($this->unixSocket ?: $this->hostname . ':' . $this->port) . ', database=' . $this->database; |
|
| 576 | + $connection = ($this->unixSocket ?: $this->hostname.':'.$this->port).', database='.$this->database; |
|
| 577 | 577 | $this->_socket = @stream_socket_client( |
| 578 | - $this->unixSocket ? 'unix://' . $this->unixSocket : 'tcp://' . $this->hostname . ':' . $this->port, |
|
| 578 | + $this->unixSocket ? 'unix://'.$this->unixSocket : 'tcp://'.$this->hostname.':'.$this->port, |
|
| 579 | 579 | $errorNumber, |
| 580 | 580 | $errorDescription, |
| 581 | 581 | $this->connectionTimeout ? $this->connectionTimeout : ini_get('default_socket_timeout'), |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | public function close() |
| 606 | 606 | { |
| 607 | 607 | if ($this->_socket !== false) { |
| 608 | - $connection = ($this->unixSocket ?: $this->hostname . ':' . $this->port) . ', database=' . $this->database; |
|
| 608 | + $connection = ($this->unixSocket ?: $this->hostname.':'.$this->port).', database='.$this->database; |
|
| 609 | 609 | try { |
| 610 | 610 | $this->executeCommand('QUIT'); |
| 611 | 611 | } catch (SocketRedisException $e) { |
@@ -717,9 +717,9 @@ discard block |
||
| 717 | 717 | $this->open(); |
| 718 | 718 | |
| 719 | 719 | $params = array_merge(explode(' ', $name), $params); |
| 720 | - $command = '*' . count($params) . "\r\n"; |
|
| 720 | + $command = '*'.count($params)."\r\n"; |
|
| 721 | 721 | foreach ($params as $arg) { |
| 722 | - $command .= '$' . mb_strlen($arg, '8bit') . "\r\n" . $arg . "\r\n"; |
|
| 722 | + $command .= '$'.mb_strlen($arg, '8bit')."\r\n".$arg."\r\n"; |
|
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | if ($this->retries > 0) { |
@@ -749,10 +749,10 @@ discard block |
||
| 749 | 749 | { |
| 750 | 750 | $written = @fwrite($this->_socket, $command); |
| 751 | 751 | if ($written === false) { |
| 752 | - throw new SocketRedisException("Failed to write to socket.\nRedis command was: " . $command); |
|
| 752 | + throw new SocketRedisException("Failed to write to socket.\nRedis command was: ".$command); |
|
| 753 | 753 | } |
| 754 | 754 | if ($written !== ($len = mb_strlen($command, '8bit'))) { |
| 755 | - throw new SocketRedisException("Failed to write to socket. $written of $len bytes written.\nRedis command was: " . $command); |
|
| 755 | + throw new SocketRedisException("Failed to write to socket. $written of $len bytes written.\nRedis command was: ".$command); |
|
| 756 | 756 | } |
| 757 | 757 | return $this->parseResponse(implode(' ', $params)); |
| 758 | 758 | } |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | private function parseResponse($command) |
| 771 | 771 | { |
| 772 | 772 | if (($line = fgets($this->_socket)) === false) { |
| 773 | - throw new SocketRedisException("Failed to read from socket.\nRedis command was: " . $command); |
|
| 773 | + throw new SocketRedisException("Failed to read from socket.\nRedis command was: ".$command); |
|
| 774 | 774 | } |
| 775 | 775 | $type = $line[0]; |
| 776 | 776 | $line = mb_substr($line, 1, -2, '8bit'); |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | return $line; |
| 783 | 783 | } |
| 784 | 784 | case '-': // Error reply |
| 785 | - throw new RedisException("Redis error: " . $line . "\nRedis command was: " . $command); |
|
| 785 | + throw new RedisException("Redis error: ".$line."\nRedis command was: ".$command); |
|
| 786 | 786 | case ':': // Integer reply |
| 787 | 787 | // no cast to int as it is in the range of a signed 64 bit integer |
| 788 | 788 | return $line; |
@@ -790,11 +790,11 @@ discard block |
||
| 790 | 790 | if ($line == '-1') { |
| 791 | 791 | return null; |
| 792 | 792 | } |
| 793 | - $length = (int)$line + 2; |
|
| 793 | + $length = (int) $line + 2; |
|
| 794 | 794 | $data = ''; |
| 795 | 795 | while ($length > 0) { |
| 796 | 796 | if (($block = fread($this->_socket, $length)) === false) { |
| 797 | - throw new SocketRedisException("Failed to read from socket.\nRedis command was: " . $command); |
|
| 797 | + throw new SocketRedisException("Failed to read from socket.\nRedis command was: ".$command); |
|
| 798 | 798 | } |
| 799 | 799 | $data .= $block; |
| 800 | 800 | $length -= mb_strlen($block, '8bit'); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | |
| 811 | 811 | return $data; |
| 812 | 812 | default: |
| 813 | - throw new RedisException('Received illegal data from redis: ' . $line . "\nRedis command was: " . $command); |
|
| 813 | + throw new RedisException('Received illegal data from redis: '.$line."\nRedis command was: ".$command); |
|
| 814 | 814 | } |
| 815 | 815 | } |
| 816 | 816 | } |