Closes the output stream if it is open.  If there are still pending
lines in the output buffer, the output window will be opened so that
the buffer can be drained.

@access public
352466
function close()
    {
        /*
         * If there are still lines waiting to be written, open the output
         * window so that we can drain the buffer.
         */
        if (!$this->_opened && (count($this->_buffer) > 0)) {
            $this->open();
        }

        if ($this->_opened) {
            $this->_writeln('</table>');
            $this->_writeln('</body></html>');
            $this->_drainBuffer();
            $this->_opened = false;
        }

        return ($this->_opened === false);
    }
795305
public function terminate()
    {
        //Cleanup and flush output to client
        if (!function_exists('fastcgi_finish_request'))
        {
            if (PHP_SAPI !== 'cli')
            {
                for ($i = 0; $i < ob_get_level(); $i++) {
                    ob_end_flush();
                }

                flush();
            }
        }
        else fastcgi_finish_request();

        //Set the exit status based on the status code.
        $status = 0;
        if(!$this->isSuccess()) {
            $status = (int) $this->getStatusCode();
        }

        exit($status);
    }
513817
public function close()
    {
        if ($this->stdOut !== null) {
            fclose($this->stdOut);
            $this->stdOut   = null;
        }
        if ($this->stdErr !== null) {
            fclose($this->stdErr);
            $this->stdErr   = null;
        }
    }
673522
function close()
    {
        if ($this->_opened) {
            mcal_close($this->_stream);
            $this->_opened = false;
        }

        return ($this->_opened === false);
    }
21568
function close() {
        if($this->closed) {
            return;
        }
        
        $this->closed = true;
        if($this->started && $this->paused) {
            $this->driver->resumeStreamConsumption();
        }
        
        $this->emit('close');
        $this->removeAllListeners();
    }
885439
public void close() {
        if (this.m_stream != null) {
            try {
                this.m_stream.close();
                this.m_stream = null;
            } catch (IOException e) {
                logger.warn("Error closing stream", e);
            }
        }
    }
989626
public function close()
    {
        if (is_resource($this->stream) === true) {
            fclose($this->stream);
        }

        $this->detach();
    }
463856
protected function end(): void
    {
        if (($this->options & self::OUTPUT_LINES) === 0) {
            fwrite($this->stream, (isset($this->delimiter) ? "\n" : '') . ']');
        }
    }
788810
function close() {
        if (isset($this->res)) {
            $this->stdout->close();
            fclose($this->pipes[0]);
            $status = $this->status();
            $exit = $status['running'] ? proc_close($this->res) : $status['exitcode'];
            unset($this->res, $this->pipes, $this->stdout);
            return $exit;
        }
        return null;
    }
1053239
public function stream_close()
    {
        @fclose($this->temporaryFileHandle);
        
        // Upload the file?
        if ($this->writeMode) {
            // Make sure the container exists
            if (! $this->containerExists($this->fileName)) {
                $this->getStorageClient($this->fileName)->createContainer($this->getContainerName($this->fileName));
            }
            
            $mimeTypeGuesser = MimeTypeGuesser::getInstance();
            $createBlobOptions = new CreateBlobOptions();
            $createBlobOptions->setBlobContentType($mimeTypeGuesser->guess($this->temporaryFileName));
            
            // Upload the file
            try {
                $result = $this->getStorageClient($this->fileName)->createBlockBlob($this->getContainerName($this->fileName), $this->getFileName($this->fileName), fopen($this->temporaryFileName, "r"), $createBlobOptions);
            } catch (Exception $ex) {
                $this->cleanup();
                
                throw $ex;
            }
        }
        
        $this->cleanup();
    }
781775
public function close()
    {
        if ($this->process === null) {
            return;
        }

        $this->stdin->close();
        $this->stdout->close();
        $this->stderr->close();

        if ($this->isSigchildEnabled() && $this->enhanceSigchildCompatibility) {
            $this->pollExitCodePipe();
            $this->closeExitCodePipe();
        }

        $this->terminate();
        $exitCode      = proc_close($this->process);
        $this->process = null;

        if ($this->exitCode === null && $exitCode !== -1) {
            $this->exitCode = $exitCode;
        }

        if ($this->exitCode === null && $this->status['exitcode'] !== -1) {
            $this->exitCode = $this->status['exitcode'];
        }

        if ($this->exitCode === null && $this->fallbackExitCode !== null) {
            $this->exitCode         = $this->fallbackExitCode;
            $this->fallbackExitCode = null;
        }
    }
948480
public function close()
    {
        if ($this->stream === null) {
            return;
        }
        $this->flush();
        if (false === @fclose($this->stream)) {
            $metaData = stream_get_meta_data($this->stream);
            $resource = $metaData["uri"];
            $msg = "Cannot close " . $resource . ": $php_errormsg";
            throw new IOException($msg);
        }
        $this->stream = null;
    }
1305633
public function stream_close()
    {
        $this->_objectName = null;
        $this->_objectBuffer = null;
        $this->_objectSize = 0;
        $this->_position = 0;
        $this->_writeBuffer = false;
        unset($this->_oss);
    }
712579
def end
      unless ready? then
        warn "attempt to close uninitialized stream; ignored."
        return nil
      end

      if in_stream? then
        warn "attempt to close unfinished zstream; reset forced"
        reset
      end

      reset_input

      err = Zlib.send @func_end, pointer

      Zlib.handle_error err, message

      @flags = 0

      # HACK this may be wrong
      @output = nil
      @next_out.free unless @next_out.nil?
      @next_out = nil

      nil
    end
118643
public function closeFile()
    {
        if ($this->out != null) {
            $this->out->close();
            $this->out = null;
        }
    }
187617
public function close()
    {
        if (!$this->freed) {
            $this->freed = true;
            if (isset($this->bev)) {
                $this->bev->free();
            }
            $this->bev = null;
            //$this->eventLoop->interrupt();
        }
        if ($this->pool) {
            $this->pool->detach($this);
        }
    }
1185816
function close()
    {
        /* If the log file is open, close it. */
        if ($this->_opened && fclose($this->_fp)) {
            $this->_opened = false;
        }

        return ($this->_opened === false);
    }