public function writeCallback($resource, $string)
    {
        $this->body .= $string;

        if ($this->onBody === null || call_user_func($this->onBody, $this->body, $this->data) !== false) {
            return strlen($string);
        }

        //Cancel
        $this->body = null;

        return -1;
    }
public function writeCallback($resource, $string)
    {
        $this->body .= $string;

        if ($this->onBody === null || call_user_func($this->onBody, $this->body, $this->data) !== false) {
            return strlen($string);
        }

        //Cancel
        $this->body = null;

        return -1;
    }
public function writeCallback ( $ resource , $ string ) { $ this -> body .= $ string ; if ( $ this -> onBody === null || call_user_func ( $ this -> onBody , $ this -> body , $ this -> data ) !== false ) { return strlen ( $ string ) ; } //Cancel $ this -> body = null ; return - 1 ; }
Callback used to get the body content.

@param resource $resource
@param string   $string

@return int
Callback used to get the body content .