1. Go to this page and download the library: Download strukt/process 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/ */
use Strukt\ManagedSupervisor;
$supervisor = new ManagedSupervisor('mail', size: 3, restartCap: 5);
$supervisor->start(PHP_BINARY . ' ' . escapeshellarg($workerScript));
$state = ManagedSupervisor::status('mail'); // snapshot incl. workers
$running = ManagedSupervisor::running('mail'); // true while the pid is alive
$all = ManagedSupervisor::ps(); // every pool in the directory
$tail = ManagedSupervisor::tail('mail', 50); // last 50 log lines
ManagedSupervisor::kill('mail', 0); // SIGTERM one slot; respawns
ManagedSupervisor::stop('mail'); // SIGTERM the daemon; reaps
public static function run(
array $commands,
?callable $callback = null,
): ProcessResult
public function wait(callable $callback): void
public function output(): string
public function poll(?callable $callback = null): bool
public static function switchChannels(bool $switch = true): void
public function __construct(
mixed $process,
mixed $stdin,
mixed $stdout,
mixed $stderr,
)
public static function run(string $command): static
public function __construct(
mixed $process,
mixed $stdin,
mixed $stdout,
mixed $stderr,
)
public function write(string $input): int
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.