samlitowitz/php-radix-tree-generator

Generate PHP code for a Radix Tree for a static set of data

v1.0.0 2025-09-30 23:12 UTC

This package is auto-updated.

Last update: 2025-10-01 08:56:35 UTC


README

Generate PHP code for a Radix Tree for a static set of data

Table of Contents

  1. Installation
  2. Usage
    1. Configuration

Installation

Install via Composer.

composer require --dev samlitowitz/php-radix-tree-generator

Usage

  1. Create a configuration targeting the type(s) you wish to generate a collection for.

  2. Generate the desired collection(s) by running the following command

    ./vendor/bin/php-radix-tree generate config.json ./path/to/output/dir/

Configuration

A JSON schema for the configuration is available here. The example RadixTree is generated using the example configuration. The RadixTreeUnderTest, generated for unit testing, is another good example of the generated PHP source code.

This site or product includes IP2Location™ ISO 3166-2 Subdivision Code which available from https://www.ip2location.com.