PHP Class Apple_Push_API\MIME_Builder

Show file Open project: alleyinteractive/apple-news Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
add_content_from_file ( string $filepath, string $name = null ) : string Add file contents to the MIME request.
add_json_string ( string $name, string $filename, string $content ) : string Add a JSON string to the MIME request.
add_metadata ( mixed $meta ) : string Add metadata to the MIME request.
boundary ( ) : string Get the boundary.
close ( ) : string Close a file added to the MIME request.
get_debug_content ( array $args ) : string Gets the debug version of the MIME content

Private Methods

Method Description
build_attachment ( string $name, string $filename, string $content, string $mime_type, integer $size ) : string Build an attachment in the MIME request.
get_mime_type_for ( string $filepath ) : string Get the MIME type for a file.
is_valid_mime_type ( string $type ) : boolean Check if this file is a valid MIME type to be included in the bundle.

Method Details

__construct() public method

Constructor.
public __construct ( )

add_content_from_file() public method

Add file contents to the MIME request.
public add_content_from_file ( string $filepath, string $name = null ) : string
$filepath string
$name string
return string

add_json_string() public method

Add a JSON string to the MIME request.
public add_json_string ( string $name, string $filename, string $content ) : string
$name string
$filename string
$content string
return string

add_metadata() public method

Add metadata to the MIME request.
public add_metadata ( mixed $meta ) : string
$meta mixed
return string

boundary() public method

Get the boundary.
public boundary ( ) : string
return string

close() public method

Close a file added to the MIME request.
public close ( ) : string
return string

get_debug_content() public method

Gets the debug version of the MIME content
public get_debug_content ( array $args ) : string
$args array
return string