PHP Class A8C_Files, vip-mu-plugins-public

显示文件 Open project: Automattic/vip-mu-plugins-public

Public Methods

Method Description
__construct ( )
attachment_file_exists ( $file_url )
check_to_download_file ( ) Ensures a local copy of the imported xml file is available for local reading at the final import step
check_to_upload_file ( $data, $postarr )
delete_file ( $file_name )
filter_filetype_check ( $filetype_data, $file, $filename, $mimes ) Check filetype support against Mogile
filter_unique_filename ( $filename, $ext, $dir, $unique_filename_callback ) Filter's the return value of wp_unique_filename()
get_files_service_hostname ( )
get_unique_filename ( $file ) Ensure filename uniqueness prior to WP 4.5's wp_unique_filename filter
get_upload_dir ( $upload )
image_resize ( boolean $ignore, integer $id, array | string $size ) : boolean | array Image resizing service. Takes place of image_downsize().
save_image_file ( $override, $filename, $image, $mime_type, $post_id )
upload_file ( $details, $upload_type )
upload_url_path ( $upload_url_path, $option )

Private Methods

Method Description
_check_uniqueness_with_backend ( $filename ) Common method to check Mogile backend for filename uniqueness
_sanitize_filename ( $filename, $ext ) Ensure consistent filename sanitization
get_upload_path ( )
purge_cache_servers ( $requests )
purge_file_cache ( $url, $method )

Method Details

__construct() public method

public __construct ( )

attachment_file_exists() public method

public attachment_file_exists ( $file_url )

check_to_download_file() public method

Ensures a local copy of the imported xml file is available for local reading at the final import step

check_to_upload_file() public method

public check_to_upload_file ( $data, $postarr )

delete_file() public method

public delete_file ( $file_name )

filter_filetype_check() public method

Leverages Mogile backend, which will return a 406 or other non-200 code if the filetype is unsupported
public filter_filetype_check ( $filetype_data, $file, $filename, $mimes )

filter_unique_filename() public method

Filter's the return value of wp_unique_filename()
public filter_unique_filename ( $filename, $ext, $dir, $unique_filename_callback )

get_files_service_hostname() public method

get_unique_filename() public method

Ensure filename uniqueness prior to WP 4.5's wp_unique_filename filter
public get_unique_filename ( $file )

get_upload_dir() public method

public get_upload_dir ( $upload )

image_resize() public method

Image resizing service. Takes place of image_downsize().
See also: image_downsize()
public image_resize ( boolean $ignore, integer $id, array | string $size ) : boolean | array
$ignore boolean Unused.
$id integer Attachment ID for image.
$size array | string Optional, default is 'medium'. Size of image, either array or string.
return boolean | array False on failure, array on success.

save_image_file() public method

public save_image_file ( $override, $filename, $image, $mime_type, $post_id )

upload_file() public method

public upload_file ( $details, $upload_type )

upload_url_path() public method

public upload_url_path ( $upload_url_path, $option )