Usage inside the PHP code¶
Forced logging¶
Force kreXX to write the analysis into a logfile:
// Force kreXX to write an analysis into a log file.
krexxlog($myObject);
// Force kreXX to write a backtrace into a log file
\Krexx::logBacktrace();
// Force the timer output into a log file
\Krexx::logTimerEnd();
Wen using the forced logging, the following things will happen:
Output destination is set to file by force.
Ajax requests will get logged by force.
Benchmarking¶
\Krexx::timerMoment('get all rows');
$notixxes = $this->notixxRepository->findAll();
\Krexx::timerMoment('assign rows to view');
$this->view->assign('notixxes', $notixxes);
\Krexx::timerEnd();
Exception handler¶
// register the exception handler
\Krexx::registerExceptionHandler();
// call undefined function to cause an error
undefinedFunctionCall();
// unregister the exception handler
\Krexx::unregisterExceptionHandler();
Scope analysis¶
Often enough a kreXX call will look like this:
krexx($this);
Analysing $this
means, that all protected and private values and methods are reachable from this point inside the code. When kreXX notices this, it will analyse all reachable variables and methods of this class.