2025-08-17 17:16:56 +02:00
2025-08-17 14:12:32 +02:00
2025-08-16 19:20:44 +02:00
2025-08-16 21:55:16 +02:00
2025-08-16 21:48:01 +02:00
2025-08-16 21:55:16 +02:00
2025-08-17 14:12:32 +02:00

NIH PHP Command Builder

Simple command builder inspired by rust's std library.

<?php

use Nih\CommandBuilder\Command;
use Nih\CommandBuilder\Stdio;

require_once __DIR__ . '/vendor/autoload.php';

$child = (new Command('/usr/bin/cat'))
    ->stdin(Stdio::piped())
    ->spawn(shell: false);

$child->stdin?->write('Hello, this is pretty cool.');
$child->stdin?->close();

$output = $child->output();

var_dump($output)

// object(Nih\CommandBuilder\Output)#4 (3) {
//   ["stdout"]=>
//   string(27) "Hello, this is pretty cool."
//   ["stderr"]=>
//   string(0) ""
//   ["code"]=>
//   int(0)
// }
Description
A (somewhat) simple command builder inspired by rust's std library
Readme MIT 70 KiB
Languages
PHP 100%