public function shutdown() { if (is_resource($this->_stream)) { fflush($this->_stream); fclose($this->_stream); $this->_stream = null; } }