PHP Class CI_Trackback, TastyIgniter

Show file Open project: tastyigniter/tastyigniter

Public Properties

Property Type Description
$charset string Character set
$convert_ascii boolean Whether to convert high-ASCII and MS Word characters to HTML entities.
$data array Trackback data
$error_msg string[] Error messages list
$response string Response

Public Methods

Method Description
__construct ( ) : void Constructor
convert_ascii ( $str ) : string High ASCII to Entities
convert_xml ( $str ) : string Convert Reserved XML characters to Entities
data ( $item ) : string Fetch a particular item
display_errors ( $open = '<p>', $close = '</p>' ) : string Show error messages
extract_urls ( $urls ) : string Extract Trackback URLs
get_id ( $url ) : string Find the Trackback URL's ID
limit_characters ( $str, $n = 500, $end_char = '&#8230;' ) : string Character limiter
process ( $url, $data ) : boolean Process Trackback
receive ( ) : boolean Receive Trackback Data
send ( $tb_data ) : boolean Send Trackback
send_error ( $message = 'Incomplete Information' ) : void Send Trackback Error Message
send_success ( ) : void Send Trackback Success Message
set_error ( $msg ) : void Set error message
validate_url ( &$url ) : void Validate URL

Method Details

__construct() public method

Constructor
public __construct ( ) : void
return void

convert_ascii() public method

Converts Hight ascii text and MS Word special chars to character entities
public convert_ascii ( $str ) : string
return string

convert_xml() public method

Convert Reserved XML characters to Entities
public convert_xml ( $str ) : string
return string

data() public method

Fetch a particular item
public data ( $item ) : string
return string

display_errors() public method

Show error messages
public display_errors ( $open = '<p>', $close = '</p>' ) : string
return string

extract_urls() public method

This function lets multiple trackbacks be sent. It takes a string of URLs (separated by comma or space) and puts each URL into an array
public extract_urls ( $urls ) : string
return string

get_id() public method

Find the Trackback URL's ID
public get_id ( $url ) : string
return string

limit_characters() public method

Limits the string based on the character count. Will preserve complete words.
public limit_characters ( $str, $n = 500, $end_char = '&#8230;' ) : string
return string

process() public method

Opens a socket connection and passes the data to the server. Returns TRUE on success, FALSE on failure
public process ( $url, $data ) : boolean
return boolean

receive() public method

This function simply validates the incoming TB data. It returns FALSE on failure and TRUE on success. If the data is valid it is set to the $this->data array so that it can be inserted into a database.
public receive ( ) : boolean
return boolean

send() public method

Send Trackback
public send ( $tb_data ) : boolean
return boolean

send_error() public method

Allows custom errors to be set. By default it sends the "incomplete information" error, as that's the most common one.
public send_error ( $message = 'Incomplete Information' ) : void
return void

send_success() public method

This should be called when a trackback has been successfully received and inserted.
public send_success ( ) : void
return void

set_error() public method

Set error message
public set_error ( $msg ) : void
return void

validate_url() public method

Simply adds "http://" if missing
public validate_url ( &$url ) : void
return void

Property Details

$charset public property

Character set
public string $charset
return string

$convert_ascii public property

Whether to convert high-ASCII and MS Word characters to HTML entities.
public bool $convert_ascii
return boolean

$data public property

Trackback data
public array $data
return array

$error_msg public property

Error messages list
public string[] $error_msg
return string[]

$response public property

Response
public string $response
return string