PHP Class SimplePie_Misc, ojs

Show file Open project: pkp/ojs Class Usage Examples

Public Methods

Method Description
absolutize_url ( $relative, $base )
array_unique ( $array )
atom_03_construct_type ( $attribs )
atom_10_construct_type ( $attribs )
atom_10_content_construct_type ( $attribs )
change_encoding ( $data, $input, $output )
codepoint_to_utf8 ( integer $codepoint ) : string Converts a unicode codepoint to a UTF-8 character
compress_parse_url ( $scheme = '', $authority = '', $path = '', $query = '', $fragment = '' )
display_cached_file ( str $identifier_url, str $cache_location = './cache', str $cache_extension = 'spc', str $cache_class = 'SimplePie_Cache', str $cache_name_function = 'md5' ) If a file has been cached, retrieve and display it.
element_implode ( $element )
encoding ( $charset )
entities_decode ( string $data ) : string Decode HTML entities
error ( $message, $level, $file, $line )
fix_protocol ( $url, $http = 1 )
get_curl_version ( )
get_element ( $realname, $string )
htmlspecialchars_decode ( $string, $quote_style )
is_isegment_nz_nc ( $string )
is_subclass_of ( $class1, $class2 )
normalize_url ( $url )
output_javascript ( )
parse_date ( $dt )
parse_mime ( $mime )
parse_str ( string $str ) : array Similar to parse_str()
parse_url ( $url )
percent_encoding_normalization ( $match )
remove_dot_segments ( $input )
space_seperated_tokens ( $string )
strip_comments ( string $data ) : string Strip HTML comments
stripos ( object $haystack, string $needle, integer $offset ) : boolean Re-implementation of PHP 5's stripos()
time_hms ( $seconds )
uncomment_rfc822 ( $string ) : string Remove RFC822 comments
utf8_bad_replace ( string $str ) : string Remove bad UTF-8 bytes
windows_1252_to_utf8 ( string $string ) : string Converts a Windows-1252 encoded string to a UTF-8 encoded string
xml_encoding ( string $data ) : array Detect XML encoding, as per XML 1.0 Appendix F.1

Method Details

absolutize_url() public method

public absolutize_url ( $relative, $base )

array_unique() public method

public array_unique ( $array )

atom_03_construct_type() public method

public atom_03_construct_type ( $attribs )

atom_10_construct_type() public method

public atom_10_construct_type ( $attribs )

atom_10_content_construct_type() public method

public atom_10_content_construct_type ( $attribs )

change_encoding() public method

public change_encoding ( $data, $input, $output )

codepoint_to_utf8() public method

Converts a unicode codepoint to a UTF-8 character
public codepoint_to_utf8 ( integer $codepoint ) : string
$codepoint integer Unicode codepoint
return string UTF-8 character

compress_parse_url() public method

public compress_parse_url ( $scheme = '', $authority = '', $path = '', $query = '', $fragment = '' )

display_cached_file() public method

This is most useful for caching images (get_favicon(), etc.), however it works for all cached files. This WILL NOT display ANY file/image/page/whatever, but rather only display what has already been cached by SimplePie.
See also: SimplePie::get_favicon()
public display_cached_file ( str $identifier_url, str $cache_location = './cache', str $cache_extension = 'spc', str $cache_class = 'SimplePie_Cache', str $cache_name_function = 'md5' )
$identifier_url str URL that is used to identify the content. This may or may not be the actual URL of the live content.
$cache_location str Location of SimplePie's cache. Defaults to './cache'.
$cache_extension str The file extension that the file was cached with. Defaults to 'spc'.
$cache_class str Name of the cache-handling class being used in SimplePie. Defaults to 'SimplePie_Cache', and should be left as-is unless you've overloaded the class.
$cache_name_function str Obsolete. Exists for backwards compatibility reasons only.

element_implode() public method

public element_implode ( $element )

encoding() public method

public encoding ( $charset )

entities_decode() public method

Decode HTML entities
public entities_decode ( string $data ) : string
$data string Input data
return string Output data

error() public method

public error ( $message, $level, $file, $line )

fix_protocol() public method

public fix_protocol ( $url, $http = 1 )

get_curl_version() public method

public get_curl_version ( )

get_element() public method

public get_element ( $realname, $string )

htmlspecialchars_decode() public method

public htmlspecialchars_decode ( $string, $quote_style )

is_isegment_nz_nc() public method

public is_isegment_nz_nc ( $string )

is_subclass_of() public method

public is_subclass_of ( $class1, $class2 )

normalize_url() public method

public normalize_url ( $url )

output_javascript() public method

public output_javascript ( )

parse_date() public method

public parse_date ( $dt )

parse_mime() public method

public parse_mime ( $mime )

parse_str() public method

Returns an associative array of name/value pairs, where the value is an array of values that have used the same name
public parse_str ( string $str ) : array
$str string The input string.
return array

parse_url() public method

public parse_url ( $url )

percent_encoding_normalization() public method

public percent_encoding_normalization ( $match )

remove_dot_segments() public method

public remove_dot_segments ( $input )

space_seperated_tokens() public method

public space_seperated_tokens ( $string )

strip_comments() public method

Strip HTML comments
public strip_comments ( string $data ) : string
$data string Data to strip comments from
return string Comment stripped string

stripos() public method

Returns the numeric position of the first occurrence of needle in the haystack string.
public stripos ( object $haystack, string $needle, integer $offset ) : boolean
$haystack object
$needle string Note that the needle may be a string of one or more characters. If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
$offset integer The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
return boolean If needle is not found, stripos() will return boolean false.

time_hms() public method

public time_hms ( $seconds )

uncomment_rfc822() public method

Remove RFC822 comments
public uncomment_rfc822 ( $string ) : string
return string Comment stripped string

utf8_bad_replace() public method

PCRE Pattern to locate bad bytes in a UTF-8 string comes from W3C FAQ: Multilingual Forms (modified to include full ASCII range)
See also: http://www.w3.org/International/questions/qa-forms-utf-8
Author: Geoffrey Sneddon
public utf8_bad_replace ( string $str ) : string
$str string String to remove bad UTF-8 bytes from
return string UTF-8 string

windows_1252_to_utf8() public method

Converts a Windows-1252 encoded string to a UTF-8 encoded string
public windows_1252_to_utf8 ( string $string ) : string
$string string Windows-1252 encoded string
return string UTF-8 encoded string

xml_encoding() public method

Detect XML encoding, as per XML 1.0 Appendix F.1
public xml_encoding ( string $data ) : array
$data string XML data
return array Possible encodings