c_ws_plugin__s2member_files_in
public class c_ws_plugin__s2member_files_in
3.5
( 18 Methods ) Method Summary | |
---|---|
public static array | amazon_cf_auto_configure_distros() Auto-configures Amazon® S3/CloudFront distros. |
public static array | amazon_cf_create_distro(str $distro_type) Creates an Amazon® S3/CloudFront Distro. |
public static array | amazon_cf_create_distros_access_origin_identity() Creates an Amazon® S3/CloudFront Access Origin Identity for all Distros. |
public static array | amazon_cf_del_access_origin_identity(str $access_id, str $access_id_etag, str $access_id_xml) Deletes an Amazon® S3/CloudFront Access Origin Identity. |
public static array | amazon_cf_del_distro(str $distro_id, str $distro_id_etag, str $distro_id_xml) Deletes an Amazon® S3/CloudFront Distro. |
public static array | amazon_cf_disable_distro(str $distro_id, str $distro_id_etag, str $distro_id_xml) Disables an Amazon® S3/CloudFront Distro. |
public static array | amazon_cf_get_access_origin_identity(str $access_id) Acquires an Amazon® S3/CloudFront Access Origin Identity. |
public static array | amazon_cf_get_distro(str $distro_id, str $distro_type) Acquires an Amazon® S3/CloudFront Distro. |
public static str|bool | amazon_cf_rsa_sign(str $string) Creates an Amazon® CloudFront RSA-SHA1 signature. |
public static str | amazon_cf_sign(str $string) Creates an Amazon® CloudFront HMAC-SHA1 signature. |
public static str | amazon_cf_url(str $file, bool $stream, bool $inline, bool $ssl, str $basename, str $mimetype) Creates an Amazon® CloudFront RSA-SHA1 signature URL. |
public static array | amazon_s3_auto_configure_acls() Auto-configures an Amazon® S3 Bucket's ACLs. |
public static str | amazon_s3_sign(str $string) Creates an Amazon® S3 HMAC-SHA1 signature. |
public static str | amazon_s3_url(str $file, bool $stream, bool $inline, bool $ssl, str $basename, str $mimetype) Creates an Amazon® S3 HMAC-SHA1 signature URL. |
public static null|str | check_file_download_access(array $create_file_download_url) Handles Download Access permissions. |
public static bool | check_file_download_key(str $file, str $key) Checks a File Download Key for validity. |
public static obj | check_file_remote_authorization(obj $user) Checks Header Authorization for Remote File Downloads. |
public static str | create_file_download_url(array $config, bool $get_streamer_array) Generates a File Download URL for access to a file protected by s2Member. |
public static array amazon_cf_auto_configure_distros()
Auto-configures Amazon® S3/CloudFront distros.
110926
array - Array containing a true success
element on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_create_distro(str $distro_type)
Creates an Amazon® S3/CloudFront Distro.
110926
str $distro_type - Required: downloads|streaming
.
array - Array containing a true success
and distro_[distro_type]_id
, distro_[distro_type]_dname
elements on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_create_distros_access_origin_identity()
Creates an Amazon® S3/CloudFront Access Origin Identity for all Distros.
110926
array - Array containing a true success
and distros_access_id
, distros_s3_access_id
elements on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_del_access_origin_identity(str $access_id, str $access_id_etag, str $access_id_xml)
Deletes an Amazon® S3/CloudFront Access Origin Identity.
110926
str $access_id - Required. An Origin Access ID.
str $access_id_etag - Required. An Origin Access ETag header.
str $access_id_xml - Required. An Origin Access Identity's XML configuration.
array - Array containing a true success
element on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_del_distro(str $distro_id, str $distro_id_etag, str $distro_id_xml)
Deletes an Amazon® S3/CloudFront Distro.
110926
str $distro_id - Required. A Distro ID.
str $distro_id_etag - Required. A Distro ETag header.
str $distro_id_xml - Required. A Distro's XML configuration.
array - Array containing a true success
element on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_disable_distro(str $distro_id, str $distro_id_etag, str $distro_id_xml)
Disables an Amazon® S3/CloudFront Distro.
110926
str $distro_id - Required. A Distro ID.
str $distro_id_etag - Required. A Distro ETag header.
str $distro_id_xml - Required. A Distro's XML configuration.
array - Array containing a true success
and etag
, xml
, deployed
elements on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_get_access_origin_identity(str $access_id)
Acquires an Amazon® S3/CloudFront Access Origin Identity.
110926
str $access_id - Required. An Origin Access ID.
array - Array containing a true success
and etag
, xml
elements on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static array amazon_cf_get_distro(str $distro_id, str $distro_type)
Acquires an Amazon® S3/CloudFront Distro.
110926
str $distro_id - Required. A Distro ID.
str $distro_type - Required: downloads|streaming
.
array - Array containing a true success
and etag
, xml
, deployed
elements on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static str|bool amazon_cf_rsa_sign(str $string)
Creates an Amazon® CloudFront RSA-SHA1 signature.
110926
str $string - Input string/data, to be signed by this routine.
str|bool - An RSA-SHA1 signature for Amazon® CloudFront, else false on failure.
public static str amazon_cf_sign(str $string)
Creates an Amazon® CloudFront HMAC-SHA1 signature.
110926
str $string - Input string/data, to be signed by this routine.
str - An HMAC-SHA1 signature for Amazon® CloudFront.
public static str amazon_cf_url(str $file, bool $stream, bool $inline, bool $ssl, str $basename, str $mimetype)
Creates an Amazon® CloudFront RSA-SHA1 signature URL.
110926
str $file - Input file path, to be signed by this routine.
bool $stream - Is this resource file to be served as streaming media?
bool $inline - Is this resource file to be served inline, or no?
bool $ssl - Is this resource file to be served via SSL, or no?
str $basename - The absolute basename of the resource file.
str $mimetype - The MIME content-type of the resource file.
str - An RSA-SHA1 signature URL for Amazon® CloudFront.
public static array amazon_s3_auto_configure_acls()
Auto-configures an Amazon® S3 Bucket's ACLs.
110926
array - Array containing a true success
element on success, else a failure array. Failure array will contain a failure code
, and a failure message
.
public static str amazon_s3_sign(str $string)
Creates an Amazon® S3 HMAC-SHA1 signature.
110524RC
str $string - Input string/data, to be signed by this routine.
str - An HMAC-SHA1 signature for Amazon® S3.
public static str amazon_s3_url(str $file, bool $stream, bool $inline, bool $ssl, str $basename, str $mimetype)
Creates an Amazon® S3 HMAC-SHA1 signature URL.
110926
str $file - Input file path, to be signed by this routine.
bool $stream - Is this resource file to be served as streaming media?
bool $inline - Is this resource file to be served inline, or no?
bool $ssl - Is this resource file to be served via SSL, or no?
str $basename - The absolute basename of the resource file.
str $mimetype - The MIME content-type of the resource file.
str - An HMAC-SHA1 signature URL for Amazon® S3.
public static null|str check_file_download_access(array $create_file_download_url)
Handles Download Access permissions.
3.5
add_action("init");
API Function s2Member\API_Functions → s2member_file_download_url(), w/ $create_file_download_url
param.
array $create_file_download_url - Optional. If this function is called directly, we can pass arguments through this array. Possible array elements: file_download
(required), file_download_key
, file_stream
, file_inline
, file_storage
, file_remote
, file_ssl
, file_rewrite
, file_rewrite_base
, skip_confirmation
, url_to_storage_source
, count_against_user
, check_user
.
null|str - If called directly with $create_file_download_url
, returns a string with the URL, based on configuration. Else, this function may exit script execution after serving a File Download.
public static bool check_file_download_key(str $file, str $key)
Checks a File Download Key for validity.
110926
str $file - Input File Download to validate.
str $key - Input File Download Key to validate.
bool - True if valid, else false.
public static obj check_file_remote_authorization(obj $user)
Checks Header Authorization for Remote File Downloads.
110926
add_filter("ws_plugin__s2member_check_file_download_access_user");
obj $user - Expects a WP_User object passed in by the Filter.
obj - A WP_User
object, possibly obtained through Header Authorization.
public static str create_file_download_url(array $config, bool $get_streamer_array)
Generates a File Download URL for access to a file protected by s2Member.
110926
array $config - Required. This is an array of configuration options associated with permissions being checked against the current User/Member; and also the actual URL generated by this routine. Possible $config
array elements: file_download
(required), file_download_key
, file_stream
, file_inline
, file_storage
, file_remote
, file_ssl
, file_rewrite
, file_rewrite_base
, skip_confirmation
, url_to_storage_source
, count_against_user
, check_user
.
bool $get_streamer_array - Optional. Defaults to false
. If true
, this function will return an array with the following elements: streamer
, file
, url
. For further details, please review this section in your Dashboard: s2Member -› Download Options -› JW Player® & RTMP Protocol Examples
.
str - A File Download URL string on success; or an array on success, with elements streamer
, file
, url
when/if $get_streamer_array
is true; else false on any type of failure.
s2Member\API_Functions → s2member_file_download_url()
File Download routines for s2Member (inner processing routines).