V-K
V-K

Reputation: 1347

Debugging in Typo3 7.6

I have problem with debugging in Typo3 7.6. I am using \TYPO3\CMS\Core\Utility\DebugUtility::debug($this->table_info); but I don't like it. The output has conflict with my html code. I have used Krumo in previous version and I like it very much. Can anyone advise me debugger like krumo? Thank.

Upvotes: 0

Views: 1390

Answers (3)

Franz Holzinger
Franz Holzinger

Reputation: 998

You can use the TYPO3 extension fh_debug. This will generate the debug output in a HTML file. The backtrace will show you where the debugged variable resides.

debug the example for the empty variable $this->table_info:

 debugBegin();
 debug($this->table_info, '$this->table_info My Position 1');
 debugEnd();

result (Browser):

CaseContentObject.php   45  cObjGetSingle
ContentObjectRenderer.php   734 cObjGetSingle
ContentObjectRenderer.php   752 render
UserContentObject.php   41  callUserFunction
ContentObjectRenderer.php   6634    call_user_func_array
class.tx_ttproducts_pi1.php 68  main
class.tx_ttproducts_pi1_base.php    82  run
class.tx_ttproducts_main.php    434 debugBegin

debugBegin (34.22.11.12) BEGIN [--->

debugBegin

CaseContentObject.php   45  cObjGetSingle
ContentObjectRenderer.php   734 cObjGetSingle
ContentObjectRenderer.php   752 render
UserContentObject.php   41  callUserFunction
ContentObjectRenderer.php   6634    call_user_func_array
class.tx_ttproducts_pi1.php 68  main
class.tx_ttproducts_pi1_base.php    82  run
class.tx_ttproducts_main.php    435 debug

$this->table_info My Position 1

CaseContentObject.php   45  cObjGetSingle
ContentObjectRenderer.php   734 cObjGetSingle
ContentObjectRenderer.php   752 render
UserContentObject.php   41  callUserFunction
ContentObjectRenderer.php   6634    call_user_func_array
class.tx_ttproducts_pi1.php 68  main
class.tx_ttproducts_pi1_base.php    82  run
class.tx_ttproducts_main.php    436 debugEnd

debugEnd (34.22.11.12) END <---]

debugEnd

result (HTML):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Debug generated by fh_debug</title>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <link rel="stylesheet" href="../typo3conf/ext/fh_debug/res/fhdebug.css" />
</head>

<body>
<br/><p>09:53:42  02.06.2016  (34.22.11.12)</p>
<h3>Front End Debugging<br /> - counter: 1 start time, date and IP of debug session (mode "wb") (string)</h3><hr/>
<table><tr><td>CaseContentObject.php</td><td>45</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>734</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>752</td><td>render</td></tr><tr><td>UserContentObject.php</td><td>41</td><td>callUserFunction</td></tr><tr><td>ContentObjectRenderer.php</td><td>6634</td><td>call_user_func_array</td></tr><tr><td>class.tx_ttproducts_pi1.php</td><td>68</td><td>main</td></tr><tr><td>class.tx_ttproducts_pi1_base.php</td><td>82</td><td>run</td></tr><tr><td>class.tx_ttproducts_main.php</td><td>434</td><td>debugBegin</td></tr></table><br/><p>debugBegin (34.22.11.12) BEGIN [---&gt;</p>
<h3>debugBegin</h3><hr/>
<table><tr><td>CaseContentObject.php</td><td>45</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>734</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>752</td><td>render</td></tr><tr><td>UserContentObject.php</td><td>41</td><td>callUserFunction</td></tr><tr><td>ContentObjectRenderer.php</td><td>6634</td><td>call_user_func_array</td></tr><tr><td>class.tx_ttproducts_pi1.php</td><td>68</td><td>main</td></tr><tr><td>class.tx_ttproducts_pi1_base.php</td><td>82</td><td>run</td></tr><tr><td>class.tx_ttproducts_main.php</td><td>435</td><td>debug</td></tr></table><br/><p></p>
<h3>$this->table_info My Position 1</h3><hr/>
<table><tr><td>CaseContentObject.php</td><td>45</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>734</td><td>cObjGetSingle</td></tr><tr><td>ContentObjectRenderer.php</td><td>752</td><td>render</td></tr><tr><td>UserContentObject.php</td><td>41</td><td>callUserFunction</td></tr><tr><td>ContentObjectRenderer.php</td><td>6634</td><td>call_user_func_array</td></tr><tr><td>class.tx_ttproducts_pi1.php</td><td>68</td><td>main</td></tr><tr><td>class.tx_ttproducts_pi1_base.php</td><td>82</td><td>run</td></tr><tr><td>class.tx_ttproducts_main.php</td><td>436</td><td>debugEnd</td></tr></table><br/><p>debugEnd (34.22.11.12) END &lt;---]</p>
<h3>debugEnd</h3><hr/>
<br/><p>09:53:58  02.06.2016  (34.22.11.12)</p>
<h3>=== END time, date and IP of debug session  === (string)</h3><hr/>
</body>

Upvotes: 0

cptnk
cptnk

Reputation: 2420

I personally use xDebug. If you have a PHP Ide like PHPStorm its prob pre installed and you'll only have to configure it.

If you are using text editors like Sublime Text you could install its package.

If xdebug is not your thing you can alternatively just use the good old.

echo '<pre>'; print_r($debug); echo '</pre>';

Upvotes: 1

rob-ot
rob-ot

Reputation: 1264

what about :

\TYPO3\CMS\Core\Utility\DebugUtility::var_dump($this->table_info);

Upvotes: 0

Related Questions