public function makeCall($name, array $arguments = [])
    {
        if (!$this->connected) {
            $this->_connect();
        }

        // ignore connect commands
        if (in_array($name, ['connect', 'pconnect'])) {
            return;
        }

        $log = true;
        switch (strtolower($name)) {
            case 'open':
            case 'popen':
            case 'close':
            case 'setoption':
            case 'getoption':
            case 'auth':
            case 'select':
                $log = false;
                break;
        }


        $ts     = microtime(true);
        $result = call_user_func_array('parent::'.$name, $arguments);
        $ts     = (microtime(true) - $ts) * 1000;

        $isError = false;
        if ($error = $this->getLastError()) {
            $this->clearLastError();
            $isError = true;
        }

        if ($log && null !== $this->logger) {
            $this->logger->logCommand($this->getCommandString($name, $arguments), $ts, $this->name, $isError);
        }

        if ($isError) {
            throw new PHPRedisCommunicationException('Redis command failed: '.$error);
        }

        return $result;
    }
public function makeCall($name, array $arguments = [])
    {
        if (!$this->connected) {
            $this->_connect();
        }

        // ignore connect commands
        if (in_array($name, ['connect', 'pconnect'])) {
            return;
        }

        $log = true;
        switch (strtolower($name)) {
            case 'open':
            case 'popen':
            case 'close':
            case 'setoption':
            case 'getoption':
            case 'auth':
            case 'select':
                $log = false;
                break;
        }


        $ts     = microtime(true);
        $result = call_user_func_array('parent::'.$name, $arguments);
        $ts     = (microtime(true) - $ts) * 1000;

        $isError = false;
        if ($error = $this->getLastError()) {
            $this->clearLastError();
            $isError = true;
        }

        if ($log && null !== $this->logger) {
            $this->logger->logCommand($this->getCommandString($name, $arguments), $ts, $this->name, $isError);
        }

        if ($isError) {
            throw new PHPRedisCommunicationException('Redis command failed: '.$error);
        }

        return $result;
    }
public function makeCall ( $ name , array $ arguments = [ ] ) { if ( ! $ this -> connected ) { $ this -> _connect ( ) ; } // ignore connect commands if ( in_array ( $ name , [ 'connect' , 'pconnect' ] ) ) { return ; } $ log = true ; switch ( strtolower ( $ name ) ) { case 'open' : case 'popen' : case 'close' : case 'setoption' : case 'getoption' : case 'auth' : case 'select' : $ log = false ; break ; } $ ts = microtime ( true ) ; $ result = call_user_func_array ( 'parent::' . $ name , $ arguments ) ; $ ts = ( microtime ( true ) - $ ts ) * 1000 ; $ isError = false ; if ( $ error = $ this -> getLastError ( ) ) { $ this -> clearLastError ( ) ; $ isError = true ; } if ( $ log && null !== $ this -> logger ) { $ this -> logger -> logCommand ( $ this -> getCommandString ( $ name , $ arguments ) , $ ts , $ this -> name , $ isError ) ; } if ( $ isError ) { throw new PHPRedisCommunicationException ( 'Redis command failed: ' . $ error ) ; } return $ result ; }
wrap all redis calls to handle profiling

@param string $name      Redis method
@param array  $arguments Arguments to parse on the real method

@return boolean
@throws \InvalidArgumentException    If the command called does not exist
@throws PHPRedisCommunicationException If the call to redis fails
wrap all redis calls to handle profiling