Contains methods and properties used by all the OpenInivter plugins
string buildDebugHuman( )
Parses the debug buffer and renders it in a human readable form
string buildDebugXML( )
Parses the debug buffer and creates an XML from the information it contains
bool checkResponse( string $step, string $server_response)
Checks if a request was successful by searching for a token inside it
bool checkSession( )
Checks if there is any active session
bool debugRequest( )
Executes the debugger and takes action according to the local and remote debug settings
void endSession( )
string followLocation( string $result, string $old_url)
Extracts Location: header from a POST or GET request that includes the header information
mixed get( string $url, [bool $follow = false], [bool $header = false], [bool $quiet = true], [mixed $referer = false], [array $headers = array()])
Executes a GET request to the provided URL taking into consideration the settings and request options.
string getCookiePath( [ $session_id = false])
Gets the path to the file storing all the cookie for the current session
mixed getElementDOM( string $string_bulk, string $query, [string $attribute = false], string $type)
Executes an XPath query on a HTML bulk, extracting either an attribute or the node value
string getElementString( string $string_to_search, string $string_start, string $string_end)
Extracts a substring that is found between two tokens from a string
array getHiddenElements( string $string_bulk)
Extracts all the <input type='hidden'> elements from a HTML bulk
string getLogoutPath( [ $session_id = false])
Gets the path to the file storing the logout link.
void getProxy( )
string getSessionID( )
Gets the current OpenInviter session ID or creates one if there is no active session.
void init( [mixed $session_id = false])
Intializes the transport being used for request taking into consideration the settings and creating the file being used for storing cookie.
bool isEmail( string $email)
Validates an email address syntax using regular expressions
void localDebug( [string $type = 'error'])
Stores debug information to the local log files
void logAction( string $message, [string $type = 'error'])
Writes an action to a certain log file.
void login( $user, $pass)
Overridden in child classes as:
mixed parseCSV( string $file, [string $delimiter = ','])
Parses the CSV data from a string into an array, reading the first line of the bulk as the CSV header
mixed post( string $url, mixed $post_elements, [bool $follow = false], [bool $header = false], [mixed $referer = false], [array $headers = array()], [bool $raw_data = false], [bool $quiet = true])
Executes a POST request to the provided URL taking into consideration the settings and request options.
bool remoteDebug( )
Sends debug information to the OpenInviter server.
void resetDebugger( )
Empties the debug buffer and resets the errors trigger
void returnContacts( $contacts)
void startSession( [ $session_id = false])
void stopPlugin( [bool $graceful = false])
Stops the internal plugin deleting the cookie file or keeping it is the stop is being graceful
void updateDebugBuffer( string $step, string $url, string $method, [bool $response = true], [mixed $elements = false])
Updates the internal debug buffer with information about the request just performed and it's state