Usage inside the PHP code

Main analytic function

krexx($myObject);
// Or inline.
json_encode(krexx($myObject));

analysis of an extbase query result

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();

benchmarking result

Backtrace

\Krexx::backtrace();

kreXX backtrace

Exception handler

// register the exception handler
\Krexx::registerExceptionHandler();
// call undefined function to cause an error
undefinedFunctionCall();
// unregister the exception handler
\Krexx::unregisterExceptionHandler();

kreXX error handler

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.