TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
TimeTracker Class Reference
Inheritance diagram for TimeTracker:
SingletonInterface

Public Member Functions

 __construct ($isEnabled=true)
 
 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
 
 $wrapIcon
 
 $uniqueCounter = 0
 
 $tsStack = [[]]
 
 $tsStackLevel = 0
 
 $tsStackLevelMax = []
 
 $tsStackLog = []
 
 $tsStackPointer = 0
 
 $currentHashPointer = []
 
 $highlightLongerThan = 0
 

Protected Member Functions

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

Protected Attributes

 $isEnabled = false
 

Detailed Description

Frontend Timetracking functions

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

Definition at line 26 of file TimeTracker.php.

Constructor & Destructor Documentation

__construct (   $isEnabled = true)

TimeTracker constructor.

Parameters
bool$isEnabled

Definition at line 138 of file TimeTracker.php.

References TimeTracker\$isEnabled.

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 542 of file TimeTracker.php.

Referenced by TimeTracker\printTSlog().

decStackPointer ( )

Decreases the stack pointer

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

Definition at line 268 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 510 of file TimeTracker.php.

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 450 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 527 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 300 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 283 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 253 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 315 of file TimeTracker.php.

References TimeTracker\createHierarchyArray(), TimeTracker\fixContent(), 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 191 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 164 of file TimeTracker.php.

References TimeTracker\$tsStack, TimeTracker\$tsStackLevel, and TimeTracker\$tsStackPointer.

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 212 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 234 of file TimeTracker.php.

start ( )

Sets the starting time

Returns
void

Definition at line 148 of file TimeTracker.php.

References TimeTracker\getMilliseconds().

Member Data Documentation

$currentHashPointer = []

Definition at line 118 of file TimeTracker.php.

$highlightLongerThan = 0

Definition at line 125 of file TimeTracker.php.

$isEnabled = false
protected

Definition at line 32 of file TimeTracker.php.

Referenced by TimeTracker\__construct().

$LR = 1

Definition at line 47 of file TimeTracker.php.

$printConf
Initial value:
= [
'showParentKeys' => 1

Definition at line 52 of file TimeTracker.php.

$starttime = 0

Definition at line 39 of file TimeTracker.php.

Referenced by TimeTracker\getDifferenceToStarttime().

$tsStack = [[]]

Definition at line 93 of file TimeTracker.php.

Referenced by TimeTracker\push().

$tsStackLevel = 0

Definition at line 98 of file TimeTracker.php.

Referenced by TimeTracker\push().

$tsStackLevelMax = []

Definition at line 103 of file TimeTracker.php.

$tsStackLog = []

Definition at line 108 of file TimeTracker.php.

$tsStackPointer = 0

Definition at line 113 of file TimeTracker.php.

Referenced by TimeTracker\incStackPointer(), and TimeTracker\push().

$uniqueCounter = 0

Definition at line 88 of file TimeTracker.php.

$wrapError
Initial value:
= [
0 => ['', '']

Definition at line 68 of file TimeTracker.php.

$wrapIcon
Initial value:
= [
0 => ''

Definition at line 78 of file TimeTracker.php.