2018-04-15 15:25:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once __DIR__."/../vendor/autoload.php";
|
|
|
|
|
|
|
|
use NoccyLabs\Ipc\Signal\SignalTrap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$trap = new SignalTrap(SIGINT);
|
|
|
|
echo "Press ctrl-c...\n";
|
|
|
|
|
2020-06-06 21:00:48 +00:00
|
|
|
while (!$trap->isTrapped(true)) {
|
2018-04-15 15:25:55 +00:00
|
|
|
usleep(10000);
|
|
|
|
}
|
|
|
|
|
2020-06-06 21:00:48 +00:00
|
|
|
echo "Thanks!\n";
|
|
|
|
echo "And once more...\n";
|
|
|
|
|
|
|
|
while (!$trap(true)) {
|
|
|
|
usleep(10000);
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Thanks!\n";
|