Search by

dotmonk / wildling

Pattern based string generator library and CLI

Maintainers

Package info

github.com/dotmonk/wildling-php

Homepage

Issues

pkg:composer/dotmonk/wildling

Transparency log

Statistics

Installs: 42

Dependents: 0

Suggesters: 0

Stars: 0

v2.0.7 2026-07-25 01:58 UTC

This package is auto-updated.

Last update: 2026-08-25 02:06:46 UTC


README

PHP library and CLI for pattern-based string generation. Zero Composer dependencies (PHP standard library only). Requires PHP 8.1+.

Docs: Website · Sandbox · Syntax · Source

Registry: Packagist

Example

http://${'dev,stage,prod'}\-${'api,web'}#{0-2}.example.${'com,net,org'}/@.html

(The \- is a literal hyphen; bare - would mean “one letter or digit”. @ is one lowercase letter.)

That builds URL-shaped candidates: scheme http://, then environment × service × optional digits × TLD, then a one-letter path page. Three environments, two services, zero–two digits ('', 09, 0099), three TLDs, and az51948 strings — the kind of list you generate for fuzzing links or probing staging hosts, not type out.

A few of them:

  • http://dev-api.example.com/a.html / http://stage-web.example.com/z.html
  • http://dev-api0.example.net/a.html / http://prod-web9.example.org/m.html
  • http://dev-api00.example.com/a.html / http://prod-web99.example.org/z.html

Named dictionaries (%{'hosts'}) work the same way when the word lists live in files.

Try it in the sandbox, or see pattern syntax for length ranges, dictionaries, and escapes.

Install

From this repository:

cd php
./build.sh
./bin/wildling "Year 19##"

Registry (Packagist via dotmonk/wildling-php):

composer require dotmonk/wildling

Path (monorepo clone): the path package has no version in composer.json, so Composer treats it as dev-*. Pin a version with options.versions (or set "minimum-stability": "dev"):

{
  "repositories": [{
    "type": "path",
    "url": "./php",
    "options": { "versions": { "dotmonk/wildling": "2.0.6" } }
  }],
  "require": { "dotmonk/wildling": "2.0.6" }
}

As a library:

<?php
require 'vendor/autoload.php';

use Wildling\Wildling;

$wildling = Wildling::create(['Year 19##']);
$value = $wildling->next();
while ($value !== false) {
    echo $value, "\n";
    $value = $wildling->next();
}

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

The launcher uses local php when available, otherwise Docker (php:8.3-cli-alpine).

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker: copy help.txt + php -l syntax check

Project tests live in ../tests/ and are run with ../test.sh.