aboutsummaryrefslogtreecommitdiffstats
path: root/library/symfony/process/Tests/SignalListener.php
blob: 4206550f5b8b7b849e81c05954030049db365b42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

// required for signal handling
declare (ticks = 1);

pcntl_signal(SIGUSR1, function () {echo 'Caught SIGUSR1'; exit;});

$n = 0;

// ticks require activity to work - sleep(4); does not work
while ($n < 400) {
    usleep(10000);
    ++$n;
}

return;