Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Sniffer Class Reference

Content-type sniffing. More...

Public Member Functions

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

Public Attributes

SimplePie File $file
 File object.
 

Detailed Description

Content-type sniffing.

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 also
SimplePie\SimplePie\set_content_type_sniffer_class()}

@subpackage HTTP

Constructor & Destructor Documentation

◆ __construct()

Sniffer::__construct ( $file)

Create an instance of the class with the input file.

Parameters
Sniffer$fileInput file

Member Function Documentation

◆ feed_or_html()

Sniffer::feed_or_html ( )

Sniff HTML.

Return values
stringActual Content-Type

◆ get_type()

Sniffer::get_type ( )

Get the Content-Type of the specified file.

Return values
stringActual Content-Type

◆ image()

Sniffer::image ( )

Sniff images.

Return values
stringActual Content-Type

◆ text_or_binary()

Sniffer::text_or_binary ( )

Sniff text or binary.

Return values
stringActual Content-Type

◆ unknown()

Sniffer::unknown ( )

Sniff unknown.

Return values
stringActual Content-Type

The documentation for this class was generated from the following file: