Environment and development tools: Difference between revisions

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
 
(172 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{TemplateDocDev}}
[[Category:Development]]
{{ToTranslate}}


<!-- BEGIN origin interlang links -->
<!-- You can edit this section but do NOT remove these comments
    Links below will be automatically replicated on translated pages by PolyglotBot -->
[[fr:Outils_de_développement]]
[[es:Herramientas_de_Desarrollo]]
[[zh:开发环境与工具]]
<!-- END interlang links -->


Tout environnement de développement peut être utilisé.
{{TemplateDocDevEn}}
Toutefois voici une liste d'outils fortement recommandés pour leur complétude, leur qualité et la productivité du développement qu'ils apportent. Ils sont utilisés par la plupart des développeurs principaux de Dolibarr. Notons que toutes ces solutions sont gratuites et OpenSource.


== Pour tous ==
Every integrated development environment can be used.
However, this is a list of tools highly recommanded to use. They are all famous and a good help as they are featurful and of high quality. They are used by most main Dolibarr developers. Above all, they are all free and Opensource.


Voici le socle de travail recommandé, toutefois tout outil respectant les standards Web, PHP, Mysql peuvent faire l'affaire.
=[[File:Eclipsephp.jpg]] For every developer=


=== Un serveur AMP ===
These are the recommended tools but any tool compliant with PHP, MySQL and Web standards can be used.


* Apache, Mysql et PHP
==An AMP server==


Sur Linux: Ces 3 produits sont disponibles dans toutes distributions.
*AMP means Apache + MariaDB + PHP


Sur Windows: Installez WampServer 2 (base Mysql, Apache et PHP tout clé en main). Ce serveur WAMP offre le trio MySql+Apache+PHP, avec possibilité de basculer de version pour n'importe lequel de ces composants d'un simple clic).
For Linux: These 3 products are available in almost all Linux distributions by default.  


=== Firefox and plugins ===
For Windows: Install [https://www.wampserver.com/WampServer] (MariaDB SQL database, Apache and PHP in an all-in-one package) or a comparable system environment (like XAMPP).
* Firefox 3.0 with plugins: HTML Validator, Phplangeditor, Firebug + Firecookie.
You can download this on web site http://www.firefox.com


=== SquirrelSQL ===
The WAMP server offers MariaDB+Apache+PHP, with the option to change the version of any component with a simple click.
* SquirrelSQL pour l'administration de base
A télécharger depuis le site http://squirrelsql.sf.net


=== Eclipse et plugins ===
==Webbrowser (Chrome / Firefox) + plugins==
* Installation d'Eclipse 3.2 ou 3.3
A télécharger depuis le site http://www.eclipse.org


* Installation du plugin Eclipse pour PHP: PDT.
*Chrome + plugins
Pour cela, utiliser la procédure Find And Install et ajouter l'URL de mise à jour: http://download.eclipse.org/tools/pdt/updates/


== Optionnel ==
You can download Chrome from https://www.chrome.com


=== Si vous gérez d'autres projets sous SVN ===
*Firefox + plugins
* Installation du plugin pour Eclipse pour SVN: SubClipse.
Pour cela, utiliser la procédure Find And Install et ajouter l'URL de mise à jour: http://subclipse.tigris.org/install.html


=== Si vous désirez faire des scripts en Perl ===
You can download this on web site https://www.firefox.com
* Installation du plugin Eclipse pour Perl: EPIC
Pour cela, utiliser la procédure Find And Install et ajouter l'URL de mise à jour: http://e-p-i-c.sf.net/updates


=== Si vous désirez développer des modules avec le générateur UML2Dolibarr ===
or the new Firefox Developer Edition:  https://www.mozilla.org/de/firefox/developer/


Une méthode pour générer un module fonctionnel depuis l'UML est en cours de mise au point.
==A database administration tool==
Plus d'informations sur la page [[Générer un module par MDA]].
Pour l'utiliser, vous devez installer les composants suivants.


* Vérifier dans Eclipse - Help - Software update - Manage Configuration que votre Eclipse contient les composants
Using a heavy database manging client is more productive than using web tools like phpmyadmin. For such a client, you can try
- Si Eclipse 3.2:
# EMF 2.2.2
# UML2 2.0.3
- Si Eclipse 3.3:
# EMF 2.3.0
# UML2 2.1.1


Si non, les installer via la procédure '''Find And Install''' et choisir EMF et UML2 End-User.
*HeidiSQL
*SquirrelSQL
*DBeaver


* Installation de TopCased 1.4
Go on official web site of this product to download them.
Pour cela, utiliser la procédure '''Find And Install''' et ajouter l'URL de mise à jour:
http://topcased-mm.gforge.enseeiht.fr/release/update-site3.3/


* Installation d'acceleo 2.2.1
==An IDE and plugins==
Pour cela, utiliser la procédure '''Find And Install''' et ajouter l'URL de mise à jour:
http://www.acceleo.org/update/


* Installation d'UML2Dolibarr
You must then have a development IDE that support PHP, for example Eclipse PHP, PHPStorm or VSCode.
Pour cela, récupérer les projets par la commande:
<pre>
svn checkout svn://svn.forge.objectweb.org/svnroot/acceleo/trunk/modules/community/uml21/dolibarr/trunk/
</pre>
et les importer dans Eclipse.


=== Si vous êtes sous Windows ===
===Eclipse===
====Install Eclipse====
We recommend to use an Eclipse version provided on eclipse.org. For example: {{DownloadEclipse}}


* Notepad++ (pour ceux qui ne supportent pas java ou utilisent un vieux coucou trop faible pour Eclipse).
Also any version available on [http://www.eclipse.org Eclipse web site] is possible.


* WinMerge (pour la comparaison de fichiers ou répertoires)
Once Eclipse is installed, it is recommanded to setup the following parameters:
{{EclipseStandardSetup}}


* CygWin (pour la commande patch et la commande en ligne cvs si vous préferez les lignes de commandes)
====Install plugin Eclipse for PHP: PDT.====
If you installed Eclipse version and PDT is not included, all you have to do is using process Help -> Install new software -> Add -> Archive to add module:


=== Si vous désirez faire du debuggage et tunning avec XDebug ===
{{DownloadEclipsePDT}}


* Installer xdebug (package php-xdebug sous Ubuntu, fichier dll téléchargé sur http://www.xdebug.org à placer dans le répertoire ext de php sous WampServer)
Once installed, you must also setup PDT into Eclipse as explained into chapter [[Environment_and_development_tools_-_Optionnal_components#From_Eclipse]]


* Modifier le fichier php.ini (ou xdebug.ini) pour ajouter les paramètres:
====Setup Eclipse to get sources====
Once Eclipse is installed, you can connect to GIT repository to get last development version.


xdebug.remote_enable=on
For this see page [[FAQ Get,update GIT project sources]].
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=c:/temp


* Ensuite pour analyser les fichiers de profiling générés par XDebug, vous pouvez installer KCacheGrind (Linux) ou WinCacheGrind (Windows).


====Codium====
Codium is the Free version of VSCode, so the following documentation will probably be compatible with vscode too.


Here is the list of recommended add-ons:


== Configuration ==
*PHP Intelephense
Si vous êtes un développeur officiel avec accès CVS en écriture, ajouter dans la configuration CVS de votre Eclipse, une entrée CVS.
*phpdoc-comment
*PHPUnit
*PHP CS Fixer


''':ext:yourlogin@cvs.savannah.nongnu.org:/cvsroot/dolibarr'''
If you develop add-ons for Dolibarr, you will appreciate having the definitions of functions and other objects of dolibarr without having to source the complete tree of dolibarr...


Sinon il vous faut récupérer les sources depuis le tarball disponible sur le site web Dolibarr ( http://www.dolibarr.fr ) dans l'espace téléchargement
All this is done by retrieving the stubs from <nowiki>https://packagist.org/packages/caprel/dolibarr-stubs</nowiki>.
 
Once the stub is downloaded / or installed following the doc, remember to add the dolibarr-stubs file to the list of stubs of your codium, edit the file ~/.config/VSCodium/User/settings.json
<syntaxhighlight lang="json">
"intelephense.stubs": [
  "apache",
  "intl",
  "standard",
  "/media/erics/stockage/tmp/dolibarr/stubs",
],
"intelephense.environment.includePaths": [
  "/media/erics/stockage/tmp/dolibarr/stubs",
],
</syntaxhighlight>
 
===Visual Studio Code (VSCode)===
 
If you choosed VSCode, you can should the following plugin:
 
*PHP Intelephense
*Git Graph
*EditorConfig so VSCode will automatically use the setup of the project defined into .editorconfig
 
==Git Hooks==
 
===Install Pre-commit githook===
You can use git hooks to check the syntax of the file you commit and cancel (or better autofix) the commit if something is wrong.
 
Instruction to install such a precommit hook is available on this file:
 
https://github.com/Dolibarr/dolibarr/tree/develop/dev/setup/pre-commit
 
 
Such hooks will work when using git on command line but may also work when committing using your common IDE (it has been validated with Eclipse and VSC).
 
Once installed, the hook will start on your next commit to re-format your code, so your code will always match the coding syntax rules. If everybody enable this hook, everybody will use the same coding syntax rule, so it is highly recommended to enable it if you can. If something is wrong in the syntax, the commit will be immediately canceled. If it can be fixed automatically, phpcbf, installed during the install of the precommit hook, will fix it so you just have to try the commit a second time to have it validated.
 
=[[File:Computer.png]]  Optional=
There are a lot of more components you can install to get more technologies support:
[[Environment and development tools - Optionnal components]]

Latest revision as of 19:34, 4 April 2026


Every integrated development environment can be used. However, this is a list of tools highly recommanded to use. They are all famous and a good help as they are featurful and of high quality. They are used by most main Dolibarr developers. Above all, they are all free and Opensource.

Eclipsephp.jpg For every developer

These are the recommended tools but any tool compliant with PHP, MySQL and Web standards can be used.

An AMP server

  • AMP means Apache + MariaDB + PHP

For Linux: These 3 products are available in almost all Linux distributions by default.

For Windows: Install [1] (MariaDB SQL database, Apache and PHP in an all-in-one package) or a comparable system environment (like XAMPP).

The WAMP server offers MariaDB+Apache+PHP, with the option to change the version of any component with a simple click.

Webbrowser (Chrome / Firefox) + plugins

  • Chrome + plugins

You can download Chrome from https://www.chrome.com

  • Firefox + plugins

You can download this on web site https://www.firefox.com

or the new Firefox Developer Edition: https://www.mozilla.org/de/firefox/developer/

A database administration tool

Using a heavy database manging client is more productive than using web tools like phpmyadmin. For such a client, you can try

  • HeidiSQL
  • SquirrelSQL
  • DBeaver

Go on official web site of this product to download them.

An IDE and plugins

You must then have a development IDE that support PHP, for example Eclipse PHP, PHPStorm or VSCode.

Eclipse

Install Eclipse

We recommend to use an Eclipse version provided on eclipse.org. For example: https://eclipse.org/pdt/

Also any version available on Eclipse web site is possible.

Once Eclipse is installed, it is recommanded to setup the following parameters:

  • Window - Preferences - General - Workspace - Text file encoding -> UTF8
  • Window - Preferences - General - Workspace - New text file line delimiter -> Unix
  • Window - Preferences - General - Compare/Patch - Ignore white spaces -> Yes
  • Window - Preferences - General - Editor - Text editors - Tab delimiter length -> 4
  • Window - Preferences - General - Editor - Text editors - Insert spaces for tab -> No
  • Window - Preferences - General - Editor - File Association -> Add *.lang associated to "Text Editor"
  • Note: You can also disable Windows - Preferences - Java - Editor - Content Assist - Auto Activation

And if PDT is installed (see later):

  • Window - Preferences - PHP - Code Style - Formatter - Tab policy -> Tab
  • Window - Preferences - PHP - Code Style - Formatter - Default indentation for wrapped line -> 1
  • Window - Preferences - PHP - Code Style - Formatter - Default indentation for array initializer -> 0
  • Window - Preferences - PHP - Editor - Typing - Uncheck "When Pasting Adjust Indentation" (keeping this option checked create corruption of text files by adding bad end of line characters)
  • Window - Preferences - PHP - Code Style - Formatter - Use the profile provided into dev/setup/eclipse/PSR-12 [built-in].xml as Eclipse syntax formatter.
  • Note: You can also disable Windows - Preferences - PHP - Editor - Content Assist - Auto Activation

Install plugin Eclipse for PHP: PDT.

If you installed Eclipse version and PDT is not included, all you have to do is using process Help -> Install new software -> Add -> Archive to add module:

https://download.eclipse.org/releases/xxx - xxx = version

Or from the GUI of any Eclipse =>Install New Software =>Work With Kepler => Wait until list display =>General Purpose Tools Check PHP development tools (PDT)=>Install

Once installed, you must also setup PDT into Eclipse as explained into chapter Environment_and_development_tools_-_Optionnal_components#From_Eclipse

Setup Eclipse to get sources

Once Eclipse is installed, you can connect to GIT repository to get last development version.

For this see page FAQ Get,update GIT project sources.


Codium

Codium is the Free version of VSCode, so the following documentation will probably be compatible with vscode too.

Here is the list of recommended add-ons:

  • PHP Intelephense
  • phpdoc-comment
  • PHPUnit
  • PHP CS Fixer

If you develop add-ons for Dolibarr, you will appreciate having the definitions of functions and other objects of dolibarr without having to source the complete tree of dolibarr...

All this is done by retrieving the stubs from https://packagist.org/packages/caprel/dolibarr-stubs.

Once the stub is downloaded / or installed following the doc, remember to add the dolibarr-stubs file to the list of stubs of your codium, edit the file ~/.config/VSCodium/User/settings.json

"intelephense.stubs": [
  "apache",
  "intl",
  "standard",
  "/media/erics/stockage/tmp/dolibarr/stubs",
 ],
 "intelephense.environment.includePaths": [
  "/media/erics/stockage/tmp/dolibarr/stubs",
 ],

Visual Studio Code (VSCode)

If you choosed VSCode, you can should the following plugin:

  • PHP Intelephense
  • Git Graph
  • EditorConfig so VSCode will automatically use the setup of the project defined into .editorconfig

Git Hooks

Install Pre-commit githook

You can use git hooks to check the syntax of the file you commit and cancel (or better autofix) the commit if something is wrong.

Instruction to install such a precommit hook is available on this file:

https://github.com/Dolibarr/dolibarr/tree/develop/dev/setup/pre-commit


Such hooks will work when using git on command line but may also work when committing using your common IDE (it has been validated with Eclipse and VSC).

Once installed, the hook will start on your next commit to re-format your code, so your code will always match the coding syntax rules. If everybody enable this hook, everybody will use the same coding syntax rule, so it is highly recommended to enable it if you can. If something is wrong in the syntax, the commit will be immediately canceled. If it can be fixed automatically, phpcbf, installed during the install of the precommit hook, will fix it so you just have to try the commit a second time to have it validated.

Computer.png Optional

There are a lot of more components you can install to get more technologies support: Environment and development tools - Optionnal components