Development Environment
What you need to build and test the module locally.
Requirements
| Component | Version | Notes |
|---|---|---|
| PHP | 8.3+ | same version the webtrees instance runs on |
| Composer | 2.x | installs wt-shared-libs + phpstan |
| Node.js | 18+ (LTS) | for Gulp / Rollup / Mocha |
| webtrees | 2.2.x or 2.3.x | needed for PHPStan (app/ classes) and the smoke tests |
| wt-shared-libs | newest version | sibling 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.jsonsetsprepend-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.