PHP Class Webgrind_Reader, webgrind

Author: Jacob Oettinger
Mostra file Open project: jokkedk/webgrind

Public Methods

Method Description
__construct ( $dataFile, $costFormat ) Constructor
formatCost ( integer $cost, string $format = null ) : integer Formats $cost using the format in $this->costFormat or optionally the format given as input
getCalledFromInfo ( $functionNr, $calledFromNr ) : array Returns information about positions where a function has been called from
getFunctionCount ( ) : integer Returns number of functions
getFunctionInfo ( $nr ) : array Returns information about function with nr $nr
getHeader ( $header ) : string Returns value of a single header
getSubCallInfo ( $functionNr, $subCallNr ) : array Returns information about functions called by a function

Private Methods

Method Description
init ( ) : void Initializes the parser by reading initial information.
read ( $numbers = 1 )
readLine ( )
seek ( $offset, $whence = SEEK_SET )

Method Details

__construct() public method

Constructor
public __construct ( $dataFile, $costFormat )

formatCost() public method

Formats $cost using the format in $this->costFormat or optionally the format given as input
public formatCost ( integer $cost, string $format = null ) : integer
$cost integer Cost
$format string 'percent', 'msec' or 'usec'
return integer Formatted cost

getCalledFromInfo() public method

Returns information about positions where a function has been called from
public getCalledFromInfo ( $functionNr, $calledFromNr ) : array
$functionNr int Function number
$calledFromNr int Called from position nr
return array Called from information

getFunctionCount() public method

Returns number of functions
public getFunctionCount ( ) : integer
return integer

getFunctionInfo() public method

Returns information about function with nr $nr
public getFunctionInfo ( $nr ) : array
$nr int Function number
return array Function information

getHeader() public method

Returns value of a single header
public getHeader ( $header ) : string
return string Header value

getSubCallInfo() public method

Returns information about functions called by a function
public getSubCallInfo ( $functionNr, $subCallNr ) : array
$functionNr int Function number
$subCallNr int Sub call position nr
return array Sub call information