mix php.extract (ElixirPhpEmailValidator v1.0.0)

Copy Markdown View Source

Downloads ext/filter/logical_filters.c from php-src for a given ref and re-vendors the two regex strings into priv/php/, refreshing priv/php/MANIFEST.json with new checksums.

mix php.extract            # defaults to the PHP-8.5 branch
mix php.extract PHP-8.4    # a specific branch
mix php.extract php-8.4.4  # a specific release tag

The vendored regexp{0,1}.full literals are the single source of truth the library compiles (it derives both the pattern and the :re options from them). This task makes updating them auditable: it re-extracts from the canonical upstream and shows you exactly what changed (diff the resulting priv/php files in git).

Summary

Functions

Extracts the two const char regexpN[] = "..."; literals from the C source, un-escaping C backslashes, returning a map %{"regexp0" => full, "regexp1" => full} where each full is the regex exactly as PHP uses it, including the /.../iD delimiter and flags.

Downloads a URL via curl (or wget), returning the body binary. Shelling out keeps this dependency-free and dodges OTP :inets/:ssl version quirks; every dev/CI environment that has php also has curl.

raw.githubusercontent.com URL for logical_filters.c at a given ref.

Lowercase hex SHA-256 of a binary.

Functions

extract_fulls(source)

Extracts the two const char regexpN[] = "..."; literals from the C source, un-escaping C backslashes, returning a map %{"regexp0" => full, "regexp1" => full} where each full is the regex exactly as PHP uses it, including the /.../iD delimiter and flags.

fetch!(url)

Downloads a URL via curl (or wget), returning the body binary. Shelling out keeps this dependency-free and dodges OTP :inets/:ssl version quirks; every dev/CI environment that has php also has curl.

raw_url(ref)

raw.githubusercontent.com URL for logical_filters.c at a given ref.

sha(bin)

Lowercase hex SHA-256 of a binary.