PHPackages                             magicsunday/webtrees-module-base - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. magicsunday/webtrees-module-base

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

magicsunday/webtrees-module-base
================================

Shared PHP base classes (date, name, image, place processors plus module helpers) for the magicsunday/webtrees-\* chart modules.

2.5.2(1mo ago)29.7k4GPL-3.0-or-laterPHPPHP 8.3 - 8.5CI passing

Since Feb 3Pushed 2w ago1 watchersCompare

[ Source](https://github.com/magicsunday/webtrees-module-base)[ Packagist](https://packagist.org/packages/magicsunday/webtrees-module-base)[ Fund](https://paypal.me/magicsunday)[ RSS](/packages/magicsunday-webtrees-module-base/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (27)Versions (26)Used By (4)

[![Latest version](https://camo.githubusercontent.com/f833c7693340a8908c5ae897077fabe43b1368c53a0522ff47dc8bac02603de3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d6167696373756e6461792f77656274726565732d6d6f64756c652d626173653f736f72743d73656d766572)](https://github.com/magicsunday/webtrees-module-base/releases/latest)[![License](https://camo.githubusercontent.com/5968b30ed1d92f1e8478f8a6314ff7fcd1d28ab11f2efa2ab2870d11eb14c386/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6167696373756e6461792f77656274726565732d6d6f64756c652d62617365)](https://github.com/magicsunday/webtrees-module-base/blob/main/LICENSE)[![CI](https://github.com/magicsunday/webtrees-module-base/actions/workflows/ci.yml/badge.svg)](https://github.com/magicsunday/webtrees-module-base/actions/workflows/ci.yml)

webtrees-module-base
====================

[](#webtrees-module-base)

Shared PHP base classes for the [magicsunday](https://github.com/magicsunday) family of [webtrees](https://www.webtrees.net) chart modules. Centralises the date, name, image and place processing logic, common models (genealogical symbols enum, tree node), and module helpers (GitHub release-version checking with file cache) so each chart module does not have to reimplement them.

This package ships no UI of its own — it is consumed as a Composer dependency by:

- [webtrees-fan-chart](https://github.com/magicsunday/webtrees-fan-chart) — SVG ancestor fan chart
- [webtrees-pedigree-chart](https://github.com/magicsunday/webtrees-pedigree-chart) — SVG pedigree chart
- [webtrees-descendants-chart](https://github.com/magicsunday/webtrees-descendants-chart) — SVG descendants chart

Requirements
------------

[](#requirements)

- PHP 8.3 - 8.5 with extension `dom`
- [webtrees](https://www.webtrees.net/) `~2.2`

Installation
------------

[](#installation)

This package is pulled in automatically when you install any of the chart modules above. To depend on it directly from your own webtrees module:

```
composer require magicsunday/webtrees-module-base
```

If your module uses `ImageProcessor` (silhouette URL handling), declare the marker interface so the constructor's intersection type is satisfied:

```
use Fisharebest\Webtrees\Module\AbstractModule;
use Fisharebest\Webtrees\Module\ModuleCustomInterface;
use Fisharebest\Webtrees\Module\ModuleCustomTrait;
use MagicSunday\Webtrees\ModuleBase\Contract\ModuleAssetUrlInterface;

class Module extends AbstractModule implements ModuleCustomInterface, ModuleAssetUrlInterface
{
    use ModuleCustomTrait;
    // ...
}
```

`ModuleCustomTrait` already provides the required `assetUrl()` method — only the interface declaration is new.

What's inside
-------------

[](#whats-inside)

### `src/Processor/`

[](#srcprocessor)

- **`DateProcessor`** — generation-aware date formatting (compact `getFormatted*` API for tight chart labels; locale-aware legacy `getBirth*` / `getDeath*` / `getMarriage*` API for everything else)
- **`NameProcessor`** — name extraction from webtrees name HTML (DOM/XPath based — splits first/last/preferred, handles starredname, alternative and married names)
- **`ImageProcessor`** — highlight image + silhouette URL resolution
- **`PlaceProcessor`** — place name shortening (configurable parts) for chart labels

### `src/Model/`

[](#srcmodel)

- **`Symbols`** — backed enum for genealogical symbols (Birth ★, Death †, en-dash separator, MarriageDateUnknown sentinel)
- **`NameAbbreviation`** — backed enum + `resolve()` helper for the name-abbreviation strategy used in chart labels (auto / given-first / surname-first)

### `src/Module/`

[](#srcmodule)

- **`VersionInformation`** — checks GitHub releases for newer module versions, with file cache (used by the chart modules' admin pages)

### `src/Contract/`

[](#srccontract)

- **`ModuleAssetUrlInterface`** — marker interface that declares webtrees' `assetUrl()` helper so `ImageProcessor` can be type-narrowed without `method_exists` runtime checks

Development
-----------

[](#development)

See [AGENTS.md](AGENTS.md) for the full development workflow including the buildbox vs standalone modes, the `make link-base` sibling-clone pattern, and the tooling-parity policy with consumer modules.

Quick reference:

```
# Standalone clone (compose.yaml provides PHP 8 + composer)
make install
make ci-test            # phplint + phpstan + rector + phpunit + cgl
make ci-cgl             # auto-fix php-cs-fixer
make ci-rector          # auto-fix rector

# Inside the parent webtrees buildbox
composer ci:test
composer ci:cgl
composer ci:rector
```

License
-------

[](#license)

GPL-3.0-or-later — see [LICENSE](LICENSE).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance95

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~5 days

Total

19

Last Release

37d ago

Major Versions

1.1.0 → 2.0.02026-04-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/1979dde7200fccc0e21e18a29b5566f22fa01ad104e577254fe74e14ae04a297?d=identicon)[magicsunday](/maintainers/magicsunday)

---

Top Contributors

[![magicsunday](https://avatars.githubusercontent.com/u/564393?v=4)](https://github.com/magicsunday "magicsunday (66 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

genealogylibraryphpprocessorwebtreesphplibrarymoduleprocessorsharedgenealogywebtrees

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/magicsunday-webtrees-module-base/health.svg)

```
[![Health](https://phpackages.com/badges/magicsunday-webtrees-module-base/health.svg)](https://phpackages.com/packages/magicsunday-webtrees-module-base)
```

###  Alternatives

[fisharebest/webtrees

webtrees online genealogy

78221.6k22](/packages/fisharebest-webtrees)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
