PHP Class Services_Hoptoad, php-hoptoad-notifier

Mostrar archivo Open project: rich/php-hoptoad-notifier Class Usage Examples

Public Properties

Property Type Description
$apiKey mixed
$client
$environment string

Protected Properties

Property Type Description
$error_class
$file
$line
$message
$reportESTRICT boolean Report E_STRICT
$timeout integer Timeout for cUrl.
$trace

Public Methods

Method Description
__construct ( string $apiKey, string $environment = 'production', string $client = 'pear', string $reportESTRICT = false, integer $timeout = 2 ) : void Initialize the Hoptad client
action ( ) : mixed action
addXmlBacktrace ( $parent ) : void Add a Hoptoad backtrace to the XML
addXmlVars ( $parent, $key, $source ) : void Add a Hoptoad var block to the XML
buildXmlNotice ( ) : string Build up the XML to post according to the documentation at: http://help.hoptoadapp.com/faqs/api-2/notifier-api-v2
cgi_data ( ) : array cgi_data
component ( ) : mixed component
curlRequest ( $url, $headers, $body ) : integer Send the request to Hoptoad using Curl
environment ( ) : string environment
errorHandler ( string $code, string $message, string $file, string $line ) : void Handle a php error
exceptionHandler ( Exception $exception ) : void Handle a raised exception
installHandlers ( $apiKey = NULL, $environment = NULL, $client = NULL, $class = 'Services_Hoptoad' ) : void Initialize the chosen notifier and install the error and exception handlers that connect to Hoptoad
installNotifierHandlers ( ) : void Hook's this notifier to PHP error and exception handlers
notify ( mixed $error_class, string $message, string $file, string $line, array $trace, $component = NULL ) Pass the error and environment data on to Hoptoad
params ( ) : array params
pearRequest ( $url, $headers, $body ) : integer Send the request to Hoptoad using PEAR
project_root ( ) : string project_root
request_uri ( ) : string get the request uri
session ( ) : array session
setParamsForNotify ( $error_class, $message, $file, $line, $trace, $component = NULL ) : void Set the values to be used for the next notice sent to Hoptoad
setup ( ) : void A method meant specifically for subclasses to override so they don't need to handle the constructor
zendRequest ( $url, $headers, $body ) : integer Send the request to Hoptoad using Zend

Protected Methods

Method Description
handleErrorResponse ( mixed $code ) : void

Method Details

__construct() public method

Initialize the Hoptad client
Author: Rich Cavanaugh
public __construct ( string $apiKey, string $environment = 'production', string $client = 'pear', string $reportESTRICT = false, integer $timeout = 2 ) : void
$apiKey string
$environment string
$client string
$reportESTRICT string
$timeout integer
return void

action() public method

action
Author: Scott Woods
public action ( ) : mixed
return mixed

addXmlBacktrace() public method

Add a Hoptoad backtrace to the XML
Author: Rich Cavanaugh
public addXmlBacktrace ( $parent ) : void
return void

addXmlVars() public method

Add a Hoptoad var block to the XML
Author: Rich Cavanaugh
public addXmlVars ( $parent, $key, $source ) : void
return void

buildXmlNotice() public method

Build up the XML to post according to the documentation at: http://help.hoptoadapp.com/faqs/api-2/notifier-api-v2
Author: Rich Cavanaugh
public buildXmlNotice ( ) : string
return string

cgi_data() public method

cgi_data
Author: Scott Woods
public cgi_data ( ) : array
return array

component() public method

component
Author: Scott Woods
public component ( ) : mixed
return mixed

curlRequest() public method

Send the request to Hoptoad using Curl
Author: Rich Cavanaugh
public curlRequest ( $url, $headers, $body ) : integer
return integer

environment() public method

environment
Author: Rich Cavanaugh
public environment ( ) : string
return string

errorHandler() public method

Handle a php error
Author: Rich Cavanaugh
public errorHandler ( string $code, string $message, string $file, string $line ) : void
$code string
$message string
$file string
$line string
return void

exceptionHandler() public method

Handle a raised exception
Author: Rich Cavanaugh
public exceptionHandler ( Exception $exception ) : void
$exception Exception
return void

handleErrorResponse() protected method

protected handleErrorResponse ( mixed $code ) : void
$code mixed The HTTP status code from Hoptoad.
return void

installHandlers() public static method

Initialize the chosen notifier and install the error and exception handlers that connect to Hoptoad
Author: Rich Cavanaugh
public static installHandlers ( $apiKey = NULL, $environment = NULL, $client = NULL, $class = 'Services_Hoptoad' ) : void
return void

installNotifierHandlers() public method

Hook's this notifier to PHP error and exception handlers
Author: Rich Cavanaugh
public installNotifierHandlers ( ) : void
return void

notify() public method

Pass the error and environment data on to Hoptoad
Author: Rich Cavanaugh
public notify ( mixed $error_class, string $message, string $file, string $line, array $trace, $component = NULL )
$error_class mixed
$message string
$file string
$line string
$trace array

params() public method

params
Author: Scott Woods
public params ( ) : array
return array

pearRequest() public method

Send the request to Hoptoad using PEAR
Author: Rich Cavanaugh
public pearRequest ( $url, $headers, $body ) : integer
return integer

project_root() public method

project_root
Author: Scott Woods
public project_root ( ) : string
return string

request_uri() public method

get the request uri
Author: Scott Woods
public request_uri ( ) : string
return string

session() public method

session
Author: Scott Woods
public session ( ) : array
return array

setParamsForNotify() public method

Set the values to be used for the next notice sent to Hoptoad
Author: Rich Cavanaugh
public setParamsForNotify ( $error_class, $message, $file, $line, $trace, $component = NULL ) : void
return void

setup() public method

A method meant specifically for subclasses to override so they don't need to handle the constructor
Author: Rich Cavanaugh
public setup ( ) : void
return void

zendRequest() public method

Send the request to Hoptoad using Zend
Author: Rich Cavanaugh
public zendRequest ( $url, $headers, $body ) : integer
return integer

Property Details

$apiKey public_oe property

public mixed $apiKey
return mixed

$client public_oe property

public $client

$environment public_oe property

public string $environment
return string

$error_class protected_oe property

protected $error_class

$file protected_oe property

protected $file

$line protected_oe property

protected $line

$message protected_oe property

protected $message

$reportESTRICT protected_oe property

Report E_STRICT
protected bool $reportESTRICT
return boolean

$timeout protected_oe property

Timeout for cUrl.
protected int $timeout
return integer

$trace protected_oe property

protected $trace