consensus / php-d2
Provides a PHP wrapper around the D2 binary from Terrastruct.
1.0.1
2026-02-04 16:14 UTC
Requires
- consensus/d2-cli: ^0.7
README
Provides a PHP wrapper around the d2 binary.
This makes it easier to securely use d2 in PHP-based projects, such as
the D2 module for Drupal.
Usage
Require the package via Composer:
composer require consensus/php-d2
Call the provided methods like so:
use Consensus\PhpD2;
$svg = (new D2())->generateSvg($d2_input, $d2_options);