4,395
edits
| Line 123: | Line 123: | ||
Enuite, vérifier que votre navigateur n'a pas d'option pour bloquer la modification de la barre de tache par le javasscript. | Enuite, vérifier que votre navigateur n'a pas d'option pour bloquer la modification de la barre de tache par le javasscript. | ||
* Pour du tuning à la ligne de code près, installer XDebug | * Pour du tuning à la ligne de code près, installer XDebug: | ||
{{ToTranslate}} | |||
=== [[File:Logo_windows.png]] In Windows === | |||
* Download dll file '''php_debug_xxx.dll''' on http://www.xdebug.org and store it in directory /ext of php. Then enable plugin. | |||
* Modify php.ini file to add parameters: | |||
* | |||
<source lang="ini"> | <source lang="ini"> | ||
[xdebug] | [xdebug] | ||
| Line 141: | Line 141: | ||
</source> | </source> | ||
=== [[File:Logo_ubuntu.png]] In Ubuntu / Linux === | |||
* Install package '''php-xdebug''': | |||
<source lang="bash"> | |||
sudo apt-get install php5-xdebug | |||
</source> | |||
* Modify xdebug.ini to add parameters after the line zend_extension=xxx (or similar): | |||
<source lang="ini"> | |||
xdebug.remote_enable=on | |||
xdebug.remote_handle=dbgp | |||
xdebug.remote_host=localhost | |||
xdebug.remote_port=9000 | |||
xdebug.profiler_enable=1 | |||
xdebug.show_local_vars=off | |||
xdebug.profiler_output_dir=/var/tmp | |||
xdebug.profiler_append=0 | |||
</source> | |||
=== [[File:Eclipsephp.jpg]] Eclipse configuration === | |||
* Open Eclipse. In Window->Preferences->General->Web Browser, select external web browser, and set it to Default system web browser. | |||
* Go into the debug section, by Window->Preferences->PHP->Debug, and set the PHP Debugger option to XDebug (by default this is set to the Zend Debugger). Note the chekbox “Break at first line” in this page as well – you can change this later on, as required. | |||
* After you’ve applied your changes, go into the PHP Debug prespective, and go to menu Debug Configurations… Here, make sure the Server Debugger is set to XDebug, and that the PHP server points to http://localhost/ or an appropriate server location. The file section should point to the file to be debugged, relative to your workspace, the relative path maybe something /dolibarr/htdocs/index.php. | |||
* Check the URL section to see whether it points to the correct location – if not, make sure you uncheck the “Auto-Generate” check box, and enter in the correct location. Apply the changes and close the dialog box. | |||
* You should now be ready to debug Dolibarr. Click on Run->Debug or F11 to enable debugging, Eclipse should switch to the Debug View, and the page should start loading in your external browser. If “Break at First Line” checkbox was checked previously, then the program would have “stopped” at the first line. You can step into or step over subsequent lines using the controls on your top left corner. Alternatively, you can place breakpoints at various locations and stop code execution there as well. | |||
* Ensuite pour analyser les fichiers de profiling générés par XDebug, vous pouvez installer KCacheGrind (Linux) ou WinCacheGrind (Windows). | * Ensuite pour analyser les fichiers de profiling générés par XDebug, vous pouvez installer KCacheGrind (Linux) ou WinCacheGrind (Windows). | ||