gecka/composer-installer-dolibarr

Composer installer for Dolibarr modules. Routes packages of type dolibarr-module to htdocs/custom/{name}/.

Maintainers

Package info

github.com/Gecka-Apps/composer-installer-dolibarr

Homepage

Type:composer-plugin

pkg:composer/gecka/composer-installer-dolibarr

Statistics

Installs: 226

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-18 07:51 UTC

This package is auto-updated.

Last update: 2026-05-18 07:59:48 UTC


README

Packagist License PHP

Composer plugin that installs Dolibarr modules from any Composer repository (Packagist, Satis, VCS) into the standard custom/ directory.

Pair with gecka/dolibarr-module-modulemanager for an in-Dolibarr UI on top, or use it standalone from the CLI.

Features

  • Standard custom/ layout — Packages of type dolibarr-module land in custom/<name>/ relative to your composer.json.
  • Single flat vendor — Module PHP dependencies share one vendor/ tree, resolved once. Surfaces version conflicts at install time, not at runtime.
  • Dolibarr version guard — Modules can declare extra.dolibarr.min_version / max_version; the installer reads the running Dolibarr version from version.inc.php and refuses incompatible installs before any download.
  • Configurable target nameextra.dolibarr.name lets module authors override the default name derived from the package.
  • Zero-config for callers — Add the plugin to your root composer.json and composer require <module> does the right thing.

Requirements

  • PHP 8.1 or newer
  • Composer 2.x

Installation

From your Dolibarr htdocs/ directory:

composer init        # only if you don't already have a composer.json
composer require gecka/composer-installer-dolibarr

That's it. The plugin is now active for the project.

Usage

Install any Dolibarr module published as a Composer package:

composer require <vendor>/dolibarr-module-<name>

The module's files land in custom/<name>/. Activate the module the regular way through Dolibarr's Setup > Modules page.

To remove it:

composer remove <vendor>/dolibarr-module-<name>

For module authors

See CONVENTION.md for the packaging convention your module needs to follow to be installable through this plugin.

How it works

Composer resolves the root composer.json and routes every package whose type is dolibarr-module through this installer. The installer computes the target directory as follows:

  1. If the package declares extra.dolibarr.name, use it verbatim.
  2. Else, strip the dolibarr-module- prefix from the suffix of the package name (gecka/dolibarr-module-foo becomes foo).
  3. Else, fall back to the suffix as-is.

The resolved name is validated against path-traversal and filesystem-unsafe characters before being used.

Development

composer install
composer test       # run Pest test suite
composer lint       # check coding style (Pint)
composer fix        # apply coding style fixes

License

MIT, see LICENSE.

Authors

Laurent Dinclaux laurent@gecka.ncGecka

Built with 🥥 and ☕ by Gecka — Kanaky-New Caledonia 🇳🇨