aboutsummaryrefslogtreecommitdiffstats
path: root/library/symfony/process/Tests/SignalListener.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/symfony/process/Tests/SignalListener.php')
-rw-r--r--library/symfony/process/Tests/SignalListener.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/library/symfony/process/Tests/SignalListener.php b/library/symfony/process/Tests/SignalListener.php
new file mode 100644
index 000000000..4206550f5
--- /dev/null
+++ b/library/symfony/process/Tests/SignalListener.php
@@ -0,0 +1,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;