protected function checkResponse($r){
        if (!is_array($r) || !array_key_exists('code', $r)){
            $this->log("No Response found",'Warning');
            return false;
        }
        if ($r['code'] == 200){
            return true;
        } else {
            $xml = simplexml_load_string($r['body'])->Error;
            $this->log("Bad Response! ".$r['code']." ".$r['error'].": ".$xml->Code." - ".$xml->Message,'Urgent');
            return false;
        }
    }
protected function checkResponse($r){
        if (!is_array($r) || !array_key_exists('code', $r)){
            $this->log("No Response found",'Warning');
            return false;
        }
        if ($r['code'] == 200){
            return true;
        } else {
            $xml = simplexml_load_string($r['body'])->Error;
            $this->log("Bad Response! ".$r['code']." ".$r['error'].": ".$xml->Code." - ".$xml->Message,'Urgent');
            return false;
        }
    }
protected function checkResponse ( $ r ) { if ( ! is_array ( $ r ) || ! array_key_exists ( 'code' , $ r ) ) { $ this -> log ( "No Response found" , 'Warning' ) ; return false ; } if ( $ r [ 'code' ] == 200 ) { return true ; } else { $ xml = simplexml_load_string ( $ r [ 'body' ] ) -> Error ; $ this -> log ( "Bad Response! " . $ r [ 'code' ] . " " . $ r [ 'error' ] . ": " . $ xml -> Code . " - " . $ xml -> Message , 'Urgent' ) ; return false ; } }
Checks whether or not the response is OK.

Verifies whether or not the HTTP response has the 200 OK code. If the code
is not 200, the incident and error message returned are logged.
@param array $r <p>The HTTP response array. Expects the array to have
the fields <i>code</i>, <i>body</i>, and <i>error</i>.</p>
@return boolean <b>TRUE</b> if the status is 200 OK, <b>FALSE</b> otherwise.
Checks whether or not the response is OK .