fofx/utility

Utilities library

v0.0.6 2025-08-25 20:40 UTC

This package is auto-updated.

Last update: 2025-08-25 20:40:32 UTC


README

A PHP library with a few practical helpers. Uses jeremykendall/php-domain-parser for domain parsing.

  • get_tables() - List database tables for the current connection
  • download_public_suffix_list() - Ensure the Public Suffix List exists locally
  • extract_registrable_domain() - Extract a registrable domain from a URL

Installation

composer require fofx/utility

Usage

See usage examples in:

Testing and Development

To run the PHPUnit test suite through composer:

composer test

To use PHPStan for static analysis:

composer phpstan

To use PHP-CS-Fixer for code style:

composer cs-fix

Test and the PSL file

Since tests use temporary storage, to avoid network calls during tests. public_suffix_list.dat (download here) must be saved to to local/resources/.

Tests then copy this file into temporary storage. If it is missing, tests are skipped.

License

MIT