Development Environment

Setting up a local development environment

What you need to build and test the module locally.

Requirements

ComponentVersionNotes
PHP8.3+same version the webtrees instance runs on
Composer2.xinstalls wt-shared-libs + phpstan
Node.js18+ (LTS)for Gulp / Rollup / Mocha
webtrees2.2.x or 2.3.xneeded for PHPStan (app/ classes) and the smoke tests
wt-shared-libsnewest versionsibling repo at modules_v4/wt-shared-libs (composer path repo)

Location

The module lives inside a webtrees installation at modules_v4/linkenhancer/. Its composer.json pulls in the sibling shared library as a local path repository:

"repositories": [
    { "type": "path", "url": "../wt-shared-libs", "options": { "symlink": false } }
]

Setup

# PHP dependencies (installs wt-shared-libs + phpstan)
composer install

# JS dependencies (gulp, rollup, mocha, …)
npm ci

Note: composer.json sets prepend-autoloader: false — the module’s autoloader is attached to (not replacing) webtrees’ autoloader.

Bind mount

In the current setup, development is being done on Linux with the Apache web server installed natively.The source tree is exposed to the PHP runtime through a bind mount of the rpo folders into modules_v4. Run the CLI tools and PHPStan from the mount path (the path the webtrees instance sees), not the source path, so app/ and vendor/autoload.php resolve:

cd /path/to/webtrees/modules_v4/linkenhancer
composer analyse

See the CLI Scripts and PHPStan pages for the exact commands.

Last modified November 5, 2026: added cross-links (9b8168b)