public function __construct($callback) { parent::__construct($callback); list($headers, $text) = explode("\r\n\r\n", $this->value, 2); if (strpos($headers, ' 100 Continue') !== false) { list($headers, $text) = explode("\r\n\r\n", $text, 2); } # parse the headers $headers = explode("\n", str_replace("\r", '', $headers)); foreach ($headers as $header) { $header = explode(': ', $header); if (count($header) === 2) { $this->headers[$header[0]] = $header[1]; } } $this->text = $text; $this->value = $this; }
public function __construct($callback, Http $client = null) { parent::__construct($callback); $this->client = $client; }
public function __construct($callback, Http $client = null, Session $session = null) { parent::__construct($callback); $this->client = $client; $this->session = $session; }