/** * {@inheritdoc} */ public function close() { if ($this->stream !== NULL) { if (strlen($this->buffer)) { $this->stream->write(sprintf("%X\r\n%s\r\n0\r\n\r\n", strlen($this->buffer), $this->buffer)); $this->buffer = ''; } else { $this->stream->write("0\r\n\r\n"); } } parent::close(); }
/** * {@inheritdoc} */ public function close() { set_error_handler($this->handleError()); try { $chunk = inflate_add($this->context, $this->buffer, ZLIB_FINISH); } finally { $this->buffer = ''; restore_error_handler(); } if ($this->stream !== NULL) { $this->stream->write($chunk); parent::close(); } }
/** * {@inheritdoc} */ public function close() { $chunk = deflate_add($this->context, $this->buffer, ZLIB_FINISH); $this->buffer = ''; if ($this->stream !== NULL) { $this->stream->write($chunk); parent::close(); } }