/** */ public function __get($name) { switch ($name) { case 'eos': return $this->_stream->eof(); } }
/** * Find the location of the end of the header text. * * @return array 1st element: Header position, 2nd element: Length of * trailing EOL. */ protected function _findHeader() { $i = 0; while (!$this->_stream->eof()) { $data = $this->_stream->substring(0, 8192); $hdr_pos = strpos($data, "\r\n\r\n"); if ($hdr_pos !== false) { return array($hdr_pos + $i * 8192, 4); } $hdr_pos = strpos($data, "\n\n"); if ($hdr_pos !== false) { return array($hdr_pos + $i * 8192, 2); } $i++; } $this->_stream->end(); return array($this->_stream->pos(), 0); }