WC_Download_Handler::flush_output │ private static │ WC 1.0

Send the output so far to the web server.

PHP's flush() only pushes its own write buffer, so a remaining output buffer has to be flushed into it first. Only call this after file data has been output: some servers send the headers on flush(), and a read that fails before any data must still be able to send an error page instead.

Метод класса: WC_Download_Handler{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WC_Download_Handler::flush_output(): void;

Код WC_Download_Handler::flush_output() WC 11.3.0

private static function flush_output(): void {
	$buffer = ob_get_status();

	if ( $buffer && ( $buffer['flags'] & PHP_OUTPUT_HANDLER_FLUSHABLE ) ) {
		ob_flush();
	}

	flush();
}