PHP Class SimplePie_Content_Type_Sniffer, ojs

Based on the rules in http://tools.ietf.org/html/draft-abarth-mime-sniff-06 This is used since we can't always trust Content-Type headers, and is based upon the HTML5 parsing rules. This class can be overloaded with {@see \SimplePie::set_content_type_sniffer_class()}
ファイルを表示 Open project: pkp/ojs Class Usage Examples

Public Properties

Property Type Description
$file SimplePie_File File object

Public Methods

Method Description
SimplePie_Content_Type_Sniffer ( SimplePie_Content_Type_Sniffer $file ) Create an instance of the class with the input file
feed_or_html ( ) : string Sniff HTML
get_type ( ) : string Get the Content-Type of the specified file
image ( ) : string Sniff images
text_or_binary ( ) : string Sniff text or binary
unknown ( ) : string Sniff unknown

Method Details

SimplePie_Content_Type_Sniffer() public method

Create an instance of the class with the input file
public SimplePie_Content_Type_Sniffer ( SimplePie_Content_Type_Sniffer $file )
$file SimplePie_Content_Type_Sniffer Input file

feed_or_html() public method

Sniff HTML
public feed_or_html ( ) : string
return string Actual Content-Type

get_type() public method

Get the Content-Type of the specified file
public get_type ( ) : string
return string Actual Content-Type

image() public method

Sniff images
public image ( ) : string
return string Actual Content-Type

text_or_binary() public method

Sniff text or binary
public text_or_binary ( ) : string
return string Actual Content-Type

unknown() public method

Sniff unknown
public unknown ( ) : string
return string Actual Content-Type

Property Details

$file public_oe property

File object
public SimplePie_File $file
return SimplePie_File