private function exec($command)
    {
        if (null === $this->_ssh_resource) {
            throw new TransportException(sprintf('None SSH connection available.'));
        }

        if (false === $stream = ssh2_exec($this->_ssh_resource, $command)) {
            throw new TransportException(sprintf('SSH command `%s` failed.', $command));
        }

        stream_set_blocking($stream, true);
        $data = "";
        while ($buf = fread($stream, 4096)) {
            $data .= $buf;
        }
        fclose($stream);

        return $data;
    }
private function exec($command)
    {
        if (null === $this->_ssh_resource) {
            throw new TransportException(sprintf('None SSH connection available.'));
        }

        if (false === $stream = ssh2_exec($this->_ssh_resource, $command)) {
            throw new TransportException(sprintf('SSH command `%s` failed.', $command));
        }

        stream_set_blocking($stream, true);
        $data = "";
        while ($buf = fread($stream, 4096)) {
            $data .= $buf;
        }
        fclose($stream);

        return $data;
    }
private function exec ( $ command ) { if ( null === $ this -> _ssh_resource ) { throw new TransportException ( sprintf ( 'None SSH connection available.' ) ) ; } if ( false === $ stream = ssh2_exec ( $ this -> _ssh_resource , $ command ) ) { throw new TransportException ( sprintf ( 'SSH command `%s` failed.' , $ command ) ) ; } stream_set_blocking ( $ stream , true ) ; $ data = "" ; while ( $ buf = fread ( $ stream , 4096 ) ) { $ data .= $ buf ; } fclose ( $ stream ) ; return $ data ; }
Executes a command on remote server.

@param string $command

@return string

@throws \BackBee\Util\Transport\Exception\TransportException Occures if SSH connection is invalid
Executes a command on remote server .