.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============= EXT: Debugger ============= :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: Franz Holzinger :Changed: 2015-01-02T21:44:06.248894058 :Classification: fh_debug :Keywords: forDevelopers, forBeginners :Author: Franz Holzinger :Email: franz@ttproducts.de :Info 4: :Language: en |img-1| |img-2| EXT: Debugger - fh\_debug .. _EXT-Debugger: EXT: Debugger ============= Extension Key: fh\_debug Language: en Keywords: forDevelopers, forBeginners Copyright 2010-2015, Franz Holzinger, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: Debugger 1 <#__RefHeading__825_1211893060>`_ **`Introduction 3 <#__RefHeading__827_1211893060>`_** `What does it do? 3 <#__RefHeading__829_1211893060>`_ `Screenshots 4 <#__RefHeading__627_388783580>`_ **`Users manual 5 <#__RefHeading__967_1211893060>`_** `debug file 5 <#__RefHeading__629_388783580>`_ `devLog 5 <#__RefHeading__631_388783580>`_ **`Known problems 6 <#__RefHeading__833_1211893060>`_** **`ChangeLog 7 <#__RefHeading__835_1211893060>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ - This is a simple PHP debugger.Put this into your PHP file: :: debugBegin(); debug ($variable, '$variable'); debugEnd(); You can add the IP address for debug output in the EM. Enter the filename to put all output into a HTML file instead of the screen. - You can see all the debug output if you use the debug file. Make sure you have the DEBUGFILEMODE set to 'o' for overwriting. Otherwise nothing will be written, if the file already has contents! And verify the starting date and time to see that the debug really has been written during your last PHP session. - Read the EM for fh\_debug. All documentation is directly written there. - Support for the logging of errors into your own file instead of the PHP error\_log file. Just insert lines like these into your PHP file for the TYPO3 Core or for a TYPO3 extension: :: $backtrace = \JambageCom\Fhdebug\Utility\DebugFunctions::getTraceArray(); error_log('my debug code position 1 - backtrace: ' . print_r($backtrace, TRUE) . chr(13), 3, \JambageCom\Fhdebug\Utility\DebugFunctions::getErrorLogFilename()); - If you debug the TYPO3 Core on a place where the autoloader did not already include the files of fh\_debug or in the file ext\_localconf.php of a TYPO3 extension, you can use this approach example: :: public function create($cacheIdentifier, $cacheObjectName, $backendObjectName, array $backendOptions = array()) { class CacheFactory implements \TYPO3\CMS\Core\SingletonInterface { // now add the following lines to generated the debug output if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('fh_debug')) { require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('fh_debug') . 'Classes/Utility/DebugFunctions.php'); // use t3lib_extMgm::extPath in TYPO3 4.5 // some configuration: \JambageCom\Fhdebug\Utility\DebugFunctions::setErrorLogFile(''); // this is necessary if you use the error_log file // if you use the debug HTML file: \JambageCom\Fhdebug\Utility\DebugFunctions::setDebugFile('fileadmin/debug.html'); \JambageCom\Fhdebug\Utility\DebugFunctions::setDebugBegin(FALSE); \JambageCom\Fhdebug\Utility\DebugFunctions::setRecursiveDepth('12'); \JambageCom\Fhdebug\Utility\DebugFunctions::setTraceDepth('12'); \JambageCom\Fhdebug\Utility\DebugFunctions::setAppendDepth('0'); \JambageCom\Fhdebug\Utility\DebugFunctions::setTypo3Mode('ALL'); \JambageCom\Fhdebug\Utility\DebugFunctions::setActive(TRUE); \JambageCom\Fhdebug\Utility\DebugFunctions::initFile(); // show the values of some variables: \JambageCom\Fhdebug\Utility\DebugFunctions::debug($cacheIdentifier, 'create $cacheIdentifier'); \JambageCom\Fhdebug\Utility\DebugFunctions::debug($cacheObjectName, 'create $cacheObjectName'); \JambageCom\Fhdebug\Utility\DebugFunctions::debug($backendObjectName, 'create $backendObjectName'); \JambageCom\Fhdebug\Utility\DebugFunctions::debug($backendOptions, 'create $backendOptions'); \JambageCom\Fhdebug\Utility\DebugFunctions::close(); } .. _Screenshots: Screenshots ^^^^^^^^^^^ Here you see what the extension does: |img-3| The debug info is stored as a HTML file. The variable name, contents and type are shown together with leading backtrace lines. .. _Users-manual: Users manual ------------ .. _debug-file: debug file ^^^^^^^^^^ Use the generated debug file, which by default is `http://exampletypo3.com/fileadmin/debug.html `_ .You must add the '' HTML tag to the end of the file. This is because the debugger does not know how many output you will add there if you use the append functionality. In order to make sure that the debugging will be activated from the beginning of the TYPO3 process, you must follow this step. Add this line into your file typo3conf/AdditionalConfiguration.php. Maybe you need to create this file. :: preprocessRequest'; ?> .. _errorLog: errorLog ^^^^^^^^ The default error\_log file of the extension fh\_debug is “fileadmin/phpDebugErrorLog.txt”.You can use the error\_log in a case when there are troubles using the debug output file. .. _devLog: devLog ^^^^^^ You can add calls to the devLog logging function to your PHP files. This will be transformed into debug entries in the debug file. :: Example: $dataVar = array('important' => 'We need more cardboard', 'data' => 'size 1m x 0.5 m'); \TYPO3\CMS\Core\Utility\GeneralUtility::devLog($myDebug, 'myextensionkey', 0, $dataVar); This will be transformed into debug entries of a variable named “$devLogArray” in the debug file. .. _Known-problems: Known problems -------------- If you want to debug the file ext\_localconf.php, then make sure that fh\_debug is installed before that extension. Otherwise the global error object is not initialized and nothing will be debugged. No debug output is shown with backend debugging:Increase the numer 'Append [APPENDDEPTH]'. Sometimes the cached localconf.php is called several times. Then the debug output could have been overwritten by another PHP session. If you set this number high enough and repeat the execution of the PHP code, then in the end you will see its output. No debug output is shown from the file ext\_localconf.php of my extension.Make sure that the extension fh\_debug has been installed before your extension. You can change the order in the variable $TYPO3\_CONF\_VARS['EXT']['extList'] of the file typo3conf/localconf.php . The EM of TYPO3 4.5 and later overwrites the global error object.If you want to use fh\_debug in TYPO3 4.5-4.7 for the debugging of the backend, then you must modify the file t3lib/extjs/class.t3lib\_extjs\_extdirectrouter.php on line 45 and comment out that line. :: // $GLOBALS['error'] = t3lib_div::makeInstance('t3lib_extjs_ExtDirectDebug'); In TYPO3 6.0 you must modify the file typo3/sysext/core/Classes/ExtDirect/ExtDirectRouter.php and comment out that line. :: public function route($ajaxParams, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj) { // $GLOBALS['error'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\ExtDirect\\ExtDirectDebug'); If no debug output is shown, then you should check your settings for STARTFILES (remove each start file) and APPENDDEPTH (set it to higher values). Check your PHP error\_log file and give the write access rights to the debug file: :: [Mon Jun 03 13:24:30 2013] [error] [client 85.197.0.222] PHP Warning: error_log(/var/www/mydomain/fileadmin/phpDebugErrorLog.txt): failed to open stream: Permission denied in /var/www/mydomain/trunk/typo3/ext/fh_debug/lib/class.tx_fhdebug.php on line 859, referer: http://www.mydomain.com/typo3/backend.php If you want to debug the file ext\_localconf.php or ext\_tables.php, then make sure that fh\_debug has been installed before the extension which you want to debug. Some browser fail to load large HTML files with a size of about 100 MByte.Use the split command to divide the debug.html into many fileswith sizes of 10 MByte: :: split -b 10m fileadmin/debug.html mv fileadmin/xak fileadmin/xak.htm .. _ChangeLog: ChangeLog --------- initial upload 7 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 361 .. :id: Grafik1 .. :name: Grafik1 .. :width: 669