Method | Description | |
---|---|---|
count_download ( $download_data ) | ||
download ( string $file_path, integer $product_id ) | Download a file - hook into init function. | |
download_file_force ( string $file_path, string $filename ) | Force download - this is the default method. | |
download_file_redirect ( string $file_path, string $filename = '' ) | Redirect to a file to start the download. | |
download_file_xsendfile ( string $file_path, string $filename ) | Download a file using X-Sendfile, X-Lighttpd-Sendfile, or X-Accel-Redirect if available. | |
download_product ( ) | Check if we need to download a file and check validity. | |
ie_nocache_headers_fix ( array $headers ) : array | Filter headers for IE to fix issues over SSL. | |
init ( ) | Hook in methods. | |
parse_file_path ( string $file_path ) : array | Parse file path and see if its remote or local. | |
readfile_chunked ( string $file ) : boolean | readfile_chunked. |
Method | Description | |
---|---|---|
check_download_expiry ( WC_Customer_Download $download ) | Check if the download has expired. | |
check_download_login_required ( WC_Customer_Download $download ) | Check if a download requires the user to login first. | |
check_downloads_remaining ( WC_Customer_Download $download ) | Check if there are downloads remaining. | |
check_order_is_valid ( WC_Customer_Download $download ) | Check if an order is valid for downloading from. | |
check_server_config ( ) | Check and set certain server config variables to ensure downloads work as intended. | |
clean_buffers ( ) | Clean all output buffers. | |
download_error ( string $message, string $title = '', integer $status = 404 ) | Die with an error message if the download fails. | |
download_headers ( string $file_path, string $filename ) | Set headers for the download. | |
get_download_content_type ( string $file_path ) : string | Get content type of a download. |
public static download_file_force ( string $file_path, string $filename ) | ||
$file_path | string | |
$filename | string |
public static download_file_redirect ( string $file_path, string $filename = '' ) | ||
$file_path | string | |
$filename | string |
public static download_file_xsendfile ( string $file_path, string $filename ) | ||
$file_path | string | |
$filename | string |
public static download_product ( ) |
public static ie_nocache_headers_fix ( array $headers ) : array | ||
$headers | array | |
return | array |
public static parse_file_path ( string $file_path ) : array | ||
$file_path | string | |
return | array |
public static readfile_chunked ( string $file ) : boolean | ||
$file | string | |
return | boolean | Success or fail |