php-ipc/examples/signaltraps.php

16 lines
224 B
PHP
Raw Normal View History

<?php
require_once __DIR__."/../vendor/autoload.php";
use NoccyLabs\Ipc\Signal\SignalTrap;
$trap = new SignalTrap(SIGINT);
echo "Press ctrl-c...\n";
while (!$trap->isTrapped()) {
usleep(10000);
}
echo "Thanks!\n";