PHP 클래스 WC_Download_Handler

Handle digital downloads.
저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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.

메소드 상세

count_download() 공개 정적인 메소드

사용 중단:
public static count_download ( $download_data )

download() 공개 정적인 메소드

Download a file - hook into init function.
public static download ( string $file_path, integer $product_id )
$file_path string URL to file
$product_id integer of the product being downloaded

download_file_force() 공개 정적인 메소드

Force download - this is the default method.
public static download_file_force ( string $file_path, string $filename )
$file_path string
$filename string

download_file_redirect() 공개 정적인 메소드

Redirect to a file to start the download.
public static download_file_redirect ( string $file_path, string $filename = '' )
$file_path string
$filename string

download_file_xsendfile() 공개 정적인 메소드

Download a file using X-Sendfile, X-Lighttpd-Sendfile, or X-Accel-Redirect if available.
public static download_file_xsendfile ( string $file_path, string $filename )
$file_path string
$filename string

download_product() 공개 정적인 메소드

Check if we need to download a file and check validity.
public static download_product ( )

ie_nocache_headers_fix() 공개 정적인 메소드

IE bug prevents download via SSL when Cache Control and Pragma no-cache headers set.
public static ie_nocache_headers_fix ( array $headers ) : array
$headers array
리턴 array

init() 공개 정적인 메소드

Hook in methods.
public static init ( )

parse_file_path() 공개 정적인 메소드

Parse file path and see if its remote or local.
public static parse_file_path ( string $file_path ) : array
$file_path string
리턴 array

readfile_chunked() 공개 정적인 메소드

Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/.
public static readfile_chunked ( string $file ) : boolean
$file string
리턴 boolean Success or fail