2017 © Pedro Peláez
 

library system

image

phore/system

  • Wednesday, July 18, 2018
  • by dermatthes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Phore System :: Wrapper to exec()

This documentation is written along the guidelines of educational grade documentation discussed in the infracamp project. Please ask and document issues., (*1)

Goals

  • Secure and easy-to-use wrapper around exec()

Quickstart

phore_exec, (*2)

$return = phore_exec("ls -l :path", ["path"=>"some Path "])
echo $return;

phore_proc, (*3)

  • Read STDOUT/STDERR:
$result = phore_proc("ls -l *", ["/some/path"])->wait();
echo "\nStderr: " . $result->getSTDERRContents(); 
echo "\nStdOut: " . $result->getSTDOUTContents();
  • Read stream
$result = phore_proc("ls -l *", ["/some/path"])
    ->watch(1, function ($data, $len, PhoreProc $proc) use () {
        if ($data === null) {
            echo "End of stream";
            return;
        }
        echo "Steam in: $data";
    })->wait();
echo "\nStderr: " . $result->getSTDERRContents(); 

Installation

We suggest using composer:, (*4)

composer require phore/system

The Versions

18/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >7.1