public static function readfile_chunked($file) { $chunksize = 1024 * 1024; $handle = @fopen($file, 'r'); if (false === $handle) { return false; } while (!@feof($handle)) { echo @fread($handle, $chunksize); if (ob_get_length()) { ob_flush(); flush(); } } return @fclose($handle); }
/** * @deprecated */ function woocommerce_readfile_chunked($file, $retbytes = true) { _deprecated_function('woocommerce_readfile_chunked', '2.1', 'WC_Download_Handler::readfile_chunked()'); return WC_Download_Handler::readfile_chunked($file); }