strukt/process

Process execution

v1.1.0 2024-01-25 02:16 UTC

This package is auto-updated.

Last update: 2024-03-25 02:40:20 UTC


README

Build Status

PHP Process Execution

Installation

composer require strukt/process v1.0.1

Demo

#!/usr/bin/env php
<?php

use Strukt\Process;

require 'vendor/autoload.php';

// $password = "p@55w0rd";

// $p = Process::run(["ls", "ls -al"]);
// $p = Process::run(["read password ; echo \$password"], function(){
$ps = Process::run(["ping 127.0.0.1"], function($streamOutput){

	echo $streamOutput;
	//wait 5 seconds before continuing
	// sleep(5);
});

// $p = $ps->current();

// $p->write($password);
// $p->closeInput();

// $error = $p->error();
// $output = $p->read();