public function onAbort() { if ($this->terminateOnAbort && $this->stream) { $this->stream->close(); } }