PHP 클래스 BugReporter

An object for sending captured error info to an HTTP server. An object for sending captured error info to an HTTP server. In particular this is made to work with the Trac plugin Autotrac, though it would be quite simple to make another HTTP server to work with it. A simple way to use this object is to create an error handler to the following function report_bug(): function report_bug ($p_number, $p_string, $p_file, $p_line) { $reporter = new BugReporter ($p_number, $p_string, $p_file, $p_line); $reporter->setServer ("http://myserver.com/mydirectory") $reporter->sendToServer(); } The errors are always sent to the server URL plus the extension "/report". So the above example would POST the error variables to http://myserver.com/mydirectory/newreport . The error variables POSTed are: - f_backtrace - f_id - f_software - f_str - f_num - f_file - f_line - f_backtrace * - f_description - f_email
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( integer $p_number, string $p_string, string $p_file, integer $p_line, string $p_software, integer $p_version, string $p_time = "", mixed $p_backtrace = "" )
__convertBacktraceArrayToString ( array $p_backtrace ) : string Convert the backtrace array into a backtrace string.
getBacktraceString ( ) : string Get the backtrace string.
getDescription ( ) : integer Get the error reporter's description of the error.
getEmail ( ) : integer Get the error reporter's email address
getErrorNum ( ) : integer Get the number of the error.
getFile ( ) : string Get the name of the file in which the error occerrud.
getFileWithoutPath ( ) : string Return the name of the error-file, not including the path.
getFormToken ( $p_client ) : mixed Get form token to protect against CSRF attacks.
getId ( ) : string Get the Error ID Code
getLine ( ) : integer Get the line number the error occurred in.
getPHPVersion ( ) : string Gets PHP version
getPingStatus ( ) : The
getServer ( ) : string Returns the current developers' server.
getServerOS ( ) : string Gets OS info
getSoftware ( ) : string Get the name of the software the error occurred in.
getStr ( ) : The Get the error message
getTime ( ) : string Get the time of the error.
getVersion ( ) : string Get the version of the software the error occurred in.
setBacktraceString ( $p_backtrace ) : void Get Manually set the backtrace string.
setDescription ( $p_description ) : void Set the reporter's description of the error
setEmail ( $p_email ) : void Set the error reporter's email address.
setErrorNum ( $p_errorNum ) : void Manually set the number of the error which occurred.
setFile ( $p_file ) : void Manually set the file in which the error occurred.
setLine ( $p_line ) : void Manually set the line number in which the error occurred.
setPingStatus ( $p_pingingStatus ) : void When pinging status is is set to false, pingServer() returns true without actually pinging the server.
setServer ( string $p_server ) : void This changes the developers' default server.
setSoftware ( $p_software ) : void Manually set the software in which the error occurred.
setStr ( $p_str ) : void Manually set the message of the error which occurred.
setTime ( $p_time ) : void Manually set the time at which the error occurred.
setVersion ( $p_version ) : void Manually set the software version of the error which occurred.

메소드 상세

__construct() 공개 메소드

public __construct ( integer $p_number, string $p_string, string $p_file, integer $p_line, string $p_software, integer $p_version, string $p_time = "", mixed $p_backtrace = "" )
$p_number integer The PHP error number.
$p_string string The error message.
$p_file string The file which encountered the error.
$p_line integer The line number of the file which encountered the error.
$p_software string The name of the software that encountered an error.
$p_version integer The version of the software that encountered an error.
$p_time string The date and time. If left blank, it is the current date and time.
$p_backtrace mixed The stack trace. This can be an array or string.

__convertBacktraceArrayToString() 공개 메소드

Convert the backtrace array into a backtrace string.
public __convertBacktraceArrayToString ( array $p_backtrace ) : string
$p_backtrace array array The array to be converted.
리턴 string The array as a string.

getBacktraceString() 공개 메소드

Get the backtrace string.
public getBacktraceString ( ) : string
리턴 string The traceback

getDescription() 공개 메소드

Get the error reporter's description of the error.
public getDescription ( ) : integer
리턴 integer Get the user's description of the error

getEmail() 공개 메소드

Get the error reporter's email address
public getEmail ( ) : integer
리턴 integer Get the email address of the user.

getErrorNum() 공개 메소드

Get the number of the error.
public getErrorNum ( ) : integer
리턴 integer The error number

getFile() 공개 메소드

Get the name of the file in which the error occerrud.
public getFile ( ) : string
리턴 string The name of the file the crash occurred in.

getFileWithoutPath() 공개 메소드

Return the name of the error-file, not including the path.
public getFileWithoutPath ( ) : string
리턴 string The name of the file, not including the path.

getFormToken() 공개 메소드

Get form token to protect against CSRF attacks.
public getFormToken ( $p_client ) : mixed
리턴 mixed String The form token False If the no token was get.

getId() 공개 메소드

Get the Error ID Code
public getId ( ) : string
리턴 string the file's ID-code.

getLine() 공개 메소드

Get the line number the error occurred in.
public getLine ( ) : integer
리턴 integer The line number the error occurred in.

getPHPVersion() 공개 메소드

Gets PHP version
public getPHPVersion ( ) : string
리턴 string php version

getPingStatus() 공개 메소드

public getPingStatus ( ) : The
리턴 The pinging status

getServer() 공개 메소드

Returns the current developers' server.
public getServer ( ) : string
리턴 string The current server's URL.

getServerOS() 공개 메소드

Gets OS info
public getServerOS ( ) : string
리턴 string OS info

getSoftware() 공개 메소드

Get the name of the software the error occurred in.
public getSoftware ( ) : string
리턴 string The name of the software the error occurred in.

getStr() 공개 메소드

Get the error message
public getStr ( ) : The
리턴 The error-string

getTime() 공개 메소드

Get the time of the error.
public getTime ( ) : string
리턴 string The time at which the crash occurred

getVersion() 공개 메소드

Get the version of the software the error occurred in.
public getVersion ( ) : string
리턴 string The version of the software the error occurred in

setBacktraceString() 공개 메소드

Get Manually set the backtrace string.
public setBacktraceString ( $p_backtrace ) : void
리턴 void

setDescription() 공개 메소드

Set the reporter's description of the error
public setDescription ( $p_description ) : void
리턴 void

setEmail() 공개 메소드

Set the error reporter's email address.
public setEmail ( $p_email ) : void
리턴 void

setErrorNum() 공개 메소드

Manually set the number of the error which occurred.
public setErrorNum ( $p_errorNum ) : void
리턴 void

setFile() 공개 메소드

Manually set the file in which the error occurred.
public setFile ( $p_file ) : void
리턴 void

setLine() 공개 메소드

Manually set the line number in which the error occurred.
public setLine ( $p_line ) : void
리턴 void

setPingStatus() 공개 메소드

When pinging status is is set to false, pingServer() returns true without actually pinging the server.
public setPingStatus ( $p_pingingStatus ) : void
리턴 void

setServer() 공개 메소드

This changes the developers' default server.
public setServer ( string $p_server ) : void
$p_server string The URL of the new server.
리턴 void

setSoftware() 공개 메소드

Manually set the software in which the error occurred.
public setSoftware ( $p_software ) : void
리턴 void

setStr() 공개 메소드

Manually set the message of the error which occurred.
public setStr ( $p_str ) : void
리턴 void

setTime() 공개 메소드

Manually set the time at which the error occurred.
public setTime ( $p_time ) : void
리턴 void

setVersion() 공개 메소드

Manually set the software version of the error which occurred.
public setVersion ( $p_version ) : void
리턴 void