TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
TimeTracker Class Reference

Public Member Functions

 start ()
 
 push ($tslabel, $value= '')
 
 pull ($content= '')
 
 setTSlogMessage ($content, $num=0)
 
 setTSselectQuery (array $data, $msg= '')
 
 incStackPointer ()
 
 decStackPointer ()
 
 getMilliseconds ($microtime=null)
 
 getDifferenceToStarttime ($microtime=null)
 
 printTSlog ()
 

Public Attributes

 $starttime = 0
 
 $LR = 1
 
 $printConf
 
 $wrapError = array()
 
 $wrapIcon = array()
 
 $uniqueCounter = 0
 
 $tsStack = array(array())
 
 $tsStackLevel = 0
 
 $tsStackLevelMax = array()
 
 $tsStackLog = array()
 
 $tsStackPointer = 0
 
 $currentHashPointer = array()
 
 $highlightLongerThan = 0
 

Protected Member Functions

 fixContent (&$arr, $content, $depthData= '', $first=0, $vKey= '')
 
 fixCLen ($c, $v)
 
 fw ($str)
 
 createHierarchyArray (&$arr, $pointer, $uniqueId)
 

Detailed Description

Frontend Timetracking functions

Is used to register how much time is used with operations in TypoScript

Definition at line 25 of file TimeTracker.php.

Member Function Documentation

createHierarchyArray ( $arr,
  $pointer,
  $uniqueId 
)
protected

Helper function for internal data manipulation

Parameters
array$arrArray (passed by reference) and modified
int$pointerPointer value
string$uniqueIdUnique ID string
Returns
void private
See Also
printTSlog()

Definition at line 508 of file TimeTracker.php.

Referenced by TimeTracker\printTSlog().

decStackPointer ( )

Decreases the stack pointer

Returns
void
See Also
incStackPointer(), ::renderContent(), ::cObjGetSingle()

Definition at line 236 of file TimeTracker.php.

fixCLen (   $c,
  $v 
)
protected

Wraps the input content string in green colored span-tags IF the length o fthe input string exceeds $this->printConf['contentLength'] (or $this->printConf['contentLength_FILE'] if $v == "FILE"

Parameters
string$cThe content string
string$vCommand: If "FILE" then $this->printConf['contentLength_FILE'] is used for content length comparison, otherwise $this->printConf['contentLength']
Returns
string

Definition at line 476 of file TimeTracker.php.

References GeneralUtility\fixed_lgd_cs().

Referenced by TimeTracker\fixContent().

fixContent ( $arr,
  $content,
  $depthData = '',
  $first = 0,
  $vKey = '' 
)
protected

Recursively generates the content to display

Parameters
array$arrArray which is modified with content. Reference
string$contentCurrent content string for the level
string$depthDataPrefixed icons for new PM icons
bool$firstSet this for the first call from outside.
string$vKeySeems to be the previous tsStackLog key
Returns
string Returns the $content string generated/modified. Also the $arr array is modified!

Definition at line 416 of file TimeTracker.php.

References TimeTracker\fixCLen().

Referenced by TimeTracker\printTSlog().

fw (   $str)
protected

Wraps input string in a tag

Parameters
string$strThe string to be wrapped
Returns
string

Definition at line 493 of file TimeTracker.php.

Referenced by TimeTracker\printTSlog().

getDifferenceToStarttime (   $microtime = null)

Gets the difference between a given microtime value and the starting time as milliseconds.

Parameters
float$microtimeThe microtime value - if not set the current time is used
Returns
int The difference between a given microtime value and starting time as milliseconds

Definition at line 262 of file TimeTracker.php.

References TimeTracker\$starttime, and TimeTracker\getMilliseconds().

Referenced by TimeTracker\printTSlog().

getMilliseconds (   $microtime = null)

Gets a microtime value as milliseconds value.

Parameters
float$microtimeThe microtime value - if not set the current time is used
Returns
int The microtime value as milliseconds value

Definition at line 248 of file TimeTracker.php.

Referenced by TimeTracker\getDifferenceToStarttime(), and TimeTracker\start().

incStackPointer ( )

Increases the stack pointer

Returns
void
See Also
decStackPointer(), ::renderContent(), ::cObjGetSingle()

Definition at line 224 of file TimeTracker.php.

References TimeTracker\$tsStackPointer.

printTSlog ( )

Print TypoScript parsing log

Returns
string HTML table with the information about parsing times.

Definition at line 277 of file TimeTracker.php.

References TimeTracker\createHierarchyArray(), TimeTracker\fixContent(), GeneralUtility\fixed_lgd_cs(), TimeTracker\fw(), TimeTracker\getDifferenceToStarttime(), and GeneralUtility\trimExplode().

pull (   $content = '')

Pulls an element from the TypoScript tracking array

Parameters
string$contentThe content string generated within the push/pull part.
Returns
void
See Also
::cObjGetSingle(), push()

Definition at line 171 of file TimeTracker.php.

push (   $tslabel,
  $value = '' 
)

Pushes an element to the TypoScript tracking array

Parameters
string$tslabelLabel string for the entry, eg. TypoScript property name
string$valueAdditional value(?)
Returns
void
See Also
::cObjGetSingle(), pull()

Definition at line 147 of file TimeTracker.php.

References TimeTracker\$tsStackLevel.

setTSlogMessage (   $content,
  $num = 0 
)

Logs the TypoScript entry

Parameters
string$contentThe message string
int$numMessage type: 0: information, 1: message, 2: warning, 3: error
Returns
void
See Also
::CONTENT()

Definition at line 189 of file TimeTracker.php.

References GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

setTSselectQuery ( array  $data,
  $msg = '' 
)

Set TSselectQuery - for messages in TypoScript debugger.

Parameters
array$dataQuery array
string$msgMessage/Label to attach
Returns
void

Definition at line 208 of file TimeTracker.php.

start ( )

Constructor Sets the starting time

Returns
void

Definition at line 122 of file TimeTracker.php.

References TimeTracker\getMilliseconds().

Member Data Documentation

$currentHashPointer = array()

Definition at line 102 of file TimeTracker.php.

$highlightLongerThan = 0

Definition at line 109 of file TimeTracker.php.

$LR = 1

Definition at line 40 of file TimeTracker.php.

$printConf
Initial value:
= array(
'showParentKeys' => 1,
'contentLength' => 10000,
'contentLength_FILE' => 400,
'flag_tree' => 1,
'flag_messages' => 1,
'flag_queries' => 0,
'flag_content' => 0,
'allTime' => 0,
'keyLgd' => 40
)

Definition at line 45 of file TimeTracker.php.

$starttime = 0

Definition at line 32 of file TimeTracker.php.

Referenced by TimeTracker\getDifferenceToStarttime().

$tsStack = array(array())

Definition at line 77 of file TimeTracker.php.

$tsStackLevel = 0

Definition at line 82 of file TimeTracker.php.

Referenced by TimeTracker\push().

$tsStackLevelMax = array()

Definition at line 87 of file TimeTracker.php.

$tsStackLog = array()

Definition at line 92 of file TimeTracker.php.

$tsStackPointer = 0

Definition at line 97 of file TimeTracker.php.

Referenced by TimeTracker\incStackPointer().

$uniqueCounter = 0

Definition at line 72 of file TimeTracker.php.

$wrapError = array()

Definition at line 62 of file TimeTracker.php.

$wrapIcon = array()

Definition at line 67 of file TimeTracker.php.