Line 125:
Line 125:
* Para la depuración línea a línea, instale XDebug:
* Para la depuración línea a línea, instale XDebug:
−
{{ToTranslate}}
+
=== [[File:Logo_windows.png]] Windows ===
=== [[File:Logo_windows.png]] Windows ===
−
* Descargue el archivo dll '''php_debug_xxx.dll''' desde http://www.xdebug.org and store it in directory /ext of php. Seguidamente active el plugin.
+
* Descargue el archivo dll '''php_debug_xxx.dll''' desde http://www.xdebug.org y guárdelo en el directorio /ext de php. Seguidamente active el plugin.
* Modifique el archivo php.ini file añadiendo lo siguientes parámetros:
* Modifique el archivo php.ini file añadiendo lo siguientes parámetros:
Line 142:
Line 142:
</source>
</source>
−
=== [[File:Logo_ubuntu.png]] In Ubuntu / Linux ===
+
=== [[File:Logo_ubuntu.png]] Ubuntu / Linux ===
−
* Install package '''php-xdebug''':
+
* Instale el paquete '''php-xdebug''':
<source lang="bash">
<source lang="bash">
sudo apt-get install php5-xdebug
sudo apt-get install php5-xdebug
</source>
</source>
−
* Modify xdebug.ini to add parameters after the line zend_extension=xxx (or similar):
+
* Modique el archivo xdebug.ini añadiendo los siguientes parámetros después de la línea zend_extension=xxx (o similar):
<source lang="ini">
<source lang="ini">
xdebug.remote_enable=on
xdebug.remote_enable=on
Line 160:
Line 160:
</source>
</source>
−
=== [[File:Eclipsephp.jpg]] Eclipse configuration ===
+
=== [[File:Eclipsephp.jpg]] Configuración de Eclipse ===
−
* Open Eclipse. In Window->Preferences->General->Web Browser, select external web browser, and set it to Default system web browser.
+
* Abra Eclipse. En el menú Window->Preferences->General->Web Browser, seleccione external web browser, y seleccione 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.
+
* Vaya a la sección debug, Window->Preferences->PHP->Debug, y establezca la opción PHP Debugger a XDebug (por defecto este valor está establecido a Zend Debugger). Note que el chekbox “Break at first line” está activado – puede cambiarlo después, si lo necesita.
−
* 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.
+
* Después de haber aplicado los cambios, vaya a la prespectiva PHP Debug, y entre al menú Debug Configurations… Allí, asegúrese que el Server Debugger está configurado como XDebug, y que el PHP server apunta a http://localhost/ o a una dirección correcta. la sección file apunta al archivo index.php, relativo a su workspace, la ruta relativa puede ser /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.
+
* Compruebe que la sección URL apunte a la dirección correcta – de lo contrario, desmarque el checkbox “Auto-Generate”, y teclee la dirección correcta. Aplique los cambios y cierre la ventana.
−
* 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.
+
* Debería estar preparado para debugear Dolibarr. Haga clic en Run->Debug o F11 para activar el debugging, Eclipse debe pasar a la vista de Debug, y Dolibarr debe iniciarse en su explorador. Si el chexbox “Break at First Line” está activado, Dolibarr parará en la primera línea. Puede ir paso a paso por las líneas usando los controles de depuración del menú superior izquierdo. Puede poner breakpoints en varios lugares del código y la ejecución del mismo parará en ellos.
* A continuación, para analizar los archivos de perfiles generados por Xdebug, puede instalar KCacheGrind (Linux) o WinCacheGrind (Windows).
* A continuación, para analizar los archivos de perfiles generados por Xdebug, puede instalar KCacheGrind (Linux) o WinCacheGrind (Windows).