‪TYPO3CMS  11.5
TYPO3\CMS\Core\TimeTracker\TimeTracker Class Reference
Inheritance diagram for TYPO3\CMS\Core\TimeTracker\TimeTracker:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ($isEnabled=true)
 
 setEnabled (bool $isEnabled=true)
 
 start (?float $starttime=null)
 
 push ($tslabel, $value='')
 
 pull ($content='')
 
 setTSlogMessage ($content, $logLevel=LogLevel::INFO)
 
 setTSselectQuery (array $data, $msg='')
 
 incStackPointer ()
 
 decStackPointer ()
 
int getMilliseconds ($microtime=null)
 
int getDifferenceToStarttime ($microtime=null)
 
 finish ()
 
int getParseTime ()
 
string printTSlog ()
 

Public Attributes

int $starttime = 0
 
bool $LR = true
 
array $printConf
 
array $wrapError
 
array $wrapIcon
 
int $uniqueCounter = 0
 
array $tsStack = array( [] )
 
int $tsStackLevel = 0
 
array $tsStackLevelMax = array( )
 
array $tsStackLog = array( )
 
int $tsStackPointer = 0
 
array $currentHashPointer = array( )
 
int $highlightLongerThan = 0
 

Protected Member Functions

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

Protected Attributes

bool $isEnabled = false
 
float $finishtime = 0
 

Detailed Description

Frontend Timetracking functions

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

Definition at line 30 of file TimeTracker.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\TimeTracker\TimeTracker::__construct (   $isEnabled = true)

TimeTracker constructor.

Parameters
bool$isEnabled

Definition at line 144 of file TimeTracker.php.

References TYPO3\CMS\Core\TimeTracker\TimeTracker\$isEnabled.

Member Function Documentation

◆ createHierarchyArray()

TYPO3\CMS\Core\TimeTracker\TimeTracker::createHierarchyArray ( $arr,
  $pointer,
  $uniqueId 
)
protected

Helper function for internal data manipulation

Parameters
array$arr‪Array (passed by reference) and modified
int$pointer‪Pointer value
string$uniqueId‪Unique ID string
See also
printTSlog()

Definition at line 589 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\printTSlog().

◆ decStackPointer()

TYPO3\CMS\Core\TimeTracker\TimeTracker::decStackPointer ( )

Decreases the stack pointer

See also
incStackPointer()
‪\TYPO3\CMS\Frontend\Page\PageGenerator::renderContent()
‪\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::cObjGetSingle()

Definition at line 284 of file TimeTracker.php.

◆ finish()

TYPO3\CMS\Core\TimeTracker\TimeTracker::finish ( )

Usually called when the page generation and output is prepared.

See also
start()

Definition at line 326 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\getParseTime().

◆ fixCLen()

string TYPO3\CMS\Core\TimeTracker\TimeTracker::fixCLen (   $c,
  $v 
)
protected

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

Parameters
string$c‪The 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 558 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\fixContent().

◆ fixContent()

string TYPO3\CMS\Core\TimeTracker\TimeTracker::fixContent ( $arr,
  $content,
  $depthData = '',
  $vKey = '' 
)
protected

Recursively generates the content to display

Parameters
array$arr‪Array which is modified with content. Reference
string$content‪Current content string for the level
string$depthData‪Prefixed icons for new PM icons
string$vKey‪Seems to be the previous tsStackLog key
Returns
‪string Returns the $content string generated/modified. Also the $arr array is modified!

Definition at line 492 of file TimeTracker.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\fixCLen().

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\printTSlog().

◆ fw()

string TYPO3\CMS\Core\TimeTracker\TimeTracker::fw (   $str)
protected

Wraps input string in a tag

Parameters
string$str‪The string to be wrapped
Returns
‪string

Definition at line 575 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\printTSlog().

◆ getDifferenceToStarttime()

int TYPO3\CMS\Core\TimeTracker\TimeTracker::getDifferenceToStarttime (   $microtime = null)

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

Parameters
float$microtime‪The 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 316 of file TimeTracker.php.

References TYPO3\CMS\Core\TimeTracker\TimeTracker\$starttime, and TYPO3\CMS\Core\TimeTracker\TimeTracker\getMilliseconds().

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\getParseTime(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\printTSlog().

◆ getMilliseconds()

int TYPO3\CMS\Core\TimeTracker\TimeTracker::getMilliseconds (   $microtime = null)

Gets a microtime value as milliseconds value.

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

Definition at line 299 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\getDifferenceToStarttime(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\start().

◆ getParseTime()

int TYPO3\CMS\Core\TimeTracker\TimeTracker::getParseTime ( )

◆ incStackPointer()

TYPO3\CMS\Core\TimeTracker\TimeTracker::incStackPointer ( )

Increases the stack pointer

See also
decStackPointer()
‪\TYPO3\CMS\Frontend\Page\PageGenerator::renderContent()
‪\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::cObjGetSingle()

Definition at line 268 of file TimeTracker.php.

References TYPO3\CMS\Core\TimeTracker\TimeTracker\$tsStackPointer.

◆ printTSlog()

string TYPO3\CMS\Core\TimeTracker\TimeTracker::printTSlog ( )

◆ pull()

◆ push()

◆ setEnabled()

TYPO3\CMS\Core\TimeTracker\TimeTracker::setEnabled ( bool  $isEnabled = true)
Parameters
bool$isEnabled

Definition at line 152 of file TimeTracker.php.

References TYPO3\CMS\Core\TimeTracker\TimeTracker\$isEnabled.

◆ setTSlogMessage()

◆ setTSselectQuery()

TYPO3\CMS\Core\TimeTracker\TimeTracker::setTSselectQuery ( array  $data,
  $msg = '' 
)

Set TSselectQuery - for messages in TypoScript debugger.

Parameters
array$data‪Query array
string$msg‪Message/Label to attach

Definition at line 248 of file TimeTracker.php.

◆ start()

TYPO3\CMS\Core\TimeTracker\TimeTracker::start ( ?float  $starttime = null)

Sets the starting time

See also
finish()
Parameters
float | null$starttime

Definition at line 163 of file TimeTracker.php.

References TYPO3\CMS\Core\TimeTracker\TimeTracker\getMilliseconds().

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\getParseTime().

Member Data Documentation

◆ $currentHashPointer

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$currentHashPointer = array( )

Definition at line 125 of file TimeTracker.php.

◆ $finishtime

float TYPO3\CMS\Core\TimeTracker\TimeTracker::$finishtime = 0
protected

Is set via finish() with the millisecond time when the request handler is finished.

Definition at line 47 of file TimeTracker.php.

◆ $highlightLongerThan

int TYPO3\CMS\Core\TimeTracker\TimeTracker::$highlightLongerThan = 0

Log entries that take than this number of milliseconds (own time) will be highlighted during log display. Set 0 to disable highlighting.

Definition at line 131 of file TimeTracker.php.

◆ $isEnabled

bool TYPO3\CMS\Core\TimeTracker\TimeTracker::$isEnabled = false
protected

If set to true (see constructor) then then the timetracking is enabled

Definition at line 35 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\__construct(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\setEnabled().

◆ $LR

bool TYPO3\CMS\Core\TimeTracker\TimeTracker::$LR = true

Log Rendering flag. If set, ->push() and ->pull() is called from the cObj->cObjGetSingle(). This determines whether or not the TypoScript parsing activity is logged. But it also slows down the rendering

Definition at line 54 of file TimeTracker.php.

◆ $printConf

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

Definition at line 58 of file TimeTracker.php.

◆ $starttime

int TYPO3\CMS\Core\TimeTracker\TimeTracker::$starttime = 0

Is loaded with the millisecond time when this object is created

Definition at line 41 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\getDifferenceToStarttime().

◆ $tsStack

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$tsStack = array( [] )

Definition at line 105 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\push().

◆ $tsStackLevel

int TYPO3\CMS\Core\TimeTracker\TimeTracker::$tsStackLevel = 0

Definition at line 109 of file TimeTracker.php.

Referenced by TYPO3\CMS\Core\TimeTracker\TimeTracker\push().

◆ $tsStackLevelMax

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$tsStackLevelMax = array( )

Definition at line 113 of file TimeTracker.php.

◆ $tsStackLog

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$tsStackLog = array( )

Definition at line 117 of file TimeTracker.php.

◆ $tsStackPointer

int TYPO3\CMS\Core\TimeTracker\TimeTracker::$tsStackPointer = 0

◆ $uniqueCounter

int TYPO3\CMS\Core\TimeTracker\TimeTracker::$uniqueCounter = 0

Definition at line 101 of file TimeTracker.php.

◆ $wrapError

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$wrapError
Initial value:
= array(
0 => ['', ''],
1 => ['<strong>', '</strong>'],
2 => ['<strong style="color:#ff6600;">', '</strong>'],
3 => ['<strong style="color:#ff0000;">', '</strong>'],
LogLevel::INFO => ['', ''],
LogLevel::NOTICE => ['<strong>', '</strong>'],
LogLevel::WARNING => ['<strong style="color:#ff6600;">', '</strong>'],
LogLevel::ERROR => ['<strong style="color:#ff0000;">', '</strong>'],
)

Definition at line 73 of file TimeTracker.php.

◆ $wrapIcon

array TYPO3\CMS\Core\TimeTracker\TimeTracker::$wrapIcon
Initial value:
= array(
0 => '',
1 => 'actions-document-info',
2 => 'status-dialog-warning',
3 => 'status-dialog-error',
LogLevel::INFO => '',
LogLevel::NOTICE => 'actions-document-info',
LogLevel::WARNING => 'status-dialog-warning',
LogLevel::ERROR => 'status-dialog-error',
)

Definition at line 87 of file TimeTracker.php.