Skip to content

samweru/strukt-process

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Process

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();