public function sendCommand($command)
    {
        if (!$this->isConnected()) {
                    return false;
        }

        // send command packet
        $this->writePacket(self::PACKET_COMMAND, self::SERVERDATA_EXECCOMMAND, $command);

        // get response
        $response_packet = $this->readPacket();
        if ($response_packet['id'] == self::PACKET_COMMAND) {
            if ($response_packet['type'] == self::SERVERDATA_RESPONSE_VALUE) {
                $this->lastResponse = $response_packet['body'];

                return $response_packet['body'];
            }
        }

        return false;
    }
public function sendCommand($command)
    {
        if (!$this->isConnected()) {
                    return false;
        }

        // send command packet
        $this->writePacket(self::PACKET_COMMAND, self::SERVERDATA_EXECCOMMAND, $command);

        // get response
        $response_packet = $this->readPacket();
        if ($response_packet['id'] == self::PACKET_COMMAND) {
            if ($response_packet['type'] == self::SERVERDATA_RESPONSE_VALUE) {
                $this->lastResponse = $response_packet['body'];

                return $response_packet['body'];
            }
        }

        return false;
    }
public function sendCommand ( $ command ) { if ( ! $ this -> isConnected ( ) ) { return false ; } // send command packet $ this -> writePacket ( self :: PACKET_COMMAND , self :: SERVERDATA_EXECCOMMAND , $ command ) ; // get response $ response_packet = $ this -> readPacket ( ) ; if ( $ response_packet [ 'id' ] == self :: PACKET_COMMAND ) { if ( $ response_packet [ 'type' ] == self :: SERVERDATA_RESPONSE_VALUE ) { $ this -> lastResponse = $ response_packet [ 'body' ] ; return $ response_packet [ 'body' ] ; } } return false ; }
Send a command to the connected server.

@param string $command

@return boolean|mixed
Send a command to the connected server .