PHP code example of lantongxue / php-nohup
1. Go to this page and download the library: Download lantongxue/php-nohup 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/ */
lantongxue / php-nohup example snippets
use lantongxue\nohup\Nohup;
$process = Nohup::run('sleep 5');
//...
$process->stop();
use lantongxue\nohup\Nohup;
$process = Nohup::run('sleep 5');
while ($process->isRunning()) {
echo '.';
sleep(1);
}
echo "Done.\n";
use lantongxue\nohup\Process;
$process = Process::loadFromPid($pid);
//or
$process = new Process($pid);
if ($process->isRunning()) {
$process->stop();
}