Generate PHP code for a Radix Tree for a static set of data
Install via Composer.
composer require --dev samlitowitz/php-radix-tree-generator
-
Create a configuration targeting the type(s) you wish to generate a collection for.
-
Generate the desired collection(s) by running the following command
./vendor/bin/php-radix-tree generate config.json ./path/to/output/dir/
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.