fastcgi_finish_request example

/** * Sends HTTP headers and content. * * @return $this */
    public function send()static
    {
        $this->sendHeaders();
        $this->sendContent();

        if (\function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        } elseif (\function_exists('litespeed_finish_request')) {
            litespeed_finish_request();
        } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
            static::closeOutputBuffers(0, true);
            flush();
        }

        return $this;
    }

    /** * Sets the response content. * * @return $this */
/** * Sends HTTP headers and content. * * @return $this */
    public function send()static
    {
        $this->sendHeaders();
        $this->sendContent();

        if (\function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        } elseif (\function_exists('litespeed_finish_request')) {
            litespeed_finish_request();
        } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
            static::closeOutputBuffers(0, true);
            flush();
        }

        return $this;
    }

    /** * Sets the response content. * * @return $this */


ignore_user_abort( true );

if ( ! headers_sent() ) {
    header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
    header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
}

// Don't run cron until the request finishes, if possible. if ( PHP_VERSION_ID >= 70016 && function_exists( 'fastcgi_finish_request' ) ) {
    fastcgi_finish_request();
} elseif ( function_exists( 'litespeed_finish_request' ) ) {
    litespeed_finish_request();
}

if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {
    die();
}

/** * Tell WordPress the cron task is running. * * @var bool */
Home | Imprint | This part of the site doesn't use cookies.