1. Go to this page and download the library: Download sinacms/multiprocess library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
useMutilprocessing\Async;
$outData = [];
Async::wait(function($code, $out, $err)use(&$outData){
// var_dump($code, $out, $err);// you can handle code runtime exception like thisif (strlen($err) != 0) {
// do sth.
}
// and you can get return value like this// more function detail see examples :)
array_push($outData, \Mutilprocessing\Async::getReturn($out));
});
// please pass $argv[1] to get argsuseMutilprocessing\Async;
Async::getArgs($argv[1], 'key');