PHP code example of phore / system

1. Go to this page and download the library: Download phore/system library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phore / system example snippets


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

$result = phore_proc("ls -l *", ["/some/path"])->wait();
echo "\nStderr: " . $result->getSTDERRContents(); 
echo "\nStdOut: " . $result->getSTDOUTContents();

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