CLI Scripts
Command-line maintenance scripts
The module ships CLI-only scripts. They are guarded: requested over HTTP (the modules_v4 directory is inside the web root) they answer 403 instead of running.
| Script | Purpose | Needs a webtrees install + DB? |
|---|---|---|
cli/build-link-index.php [--limit=N] [--tree=<id>] [--rebuild] [--flush] | build/update the link index for the XREF overview | yes |
cli/build-uid-index.php [--limit=N] [--tree=<id>] [--rebuild] [--flush] [--force] | build/update the UID index for UID lookup | yes |
cli/refresh-wthb-toc.php [--all] [--lang=<list>] [--clear] [--force] | refresh the WTHB table of contents cache (production) | yes |
test-text-tag-collector.php | standalone unit tests for the text-tag collector | no |
test-link-classifier.php | standalone unit tests for the link classifier (incl. target extraction) | no |
test-uid-tag-collector.php | standalone unit tests for the UID tag collector | no |
test-uid-index-service.php | standalone unit tests for the UID index service | no |
tests/smoke-text-tag-collector.php [limit] | scan records containing enhanced links, print every captured value | yes |
smoke-migration5.php | SQLite smoke test for Migration5 (UID index schema) | yes |
tests/p1-measure.php [--tree=<id>] | read-only scaling measurement for the XREF overview | yes |
Run them from the webtrees root with the same PHP version the instance runs on (webtrees requires PHP 8.3+):
php modules_v4/linkenhancer/tests/test-text-tag-collector.php
php modules_v4/linkenhancer/tests/smoke-text-tag-collector.php 10
Cron example (every 2 hours, 500 records per run):
15 */2 * * * cd /path/to/webtrees && php modules_v4/linkenhancer/cli/<name>.php --limit=500 >> /var/log/linkenhancer-<name>.log 2>&1