mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-54974 behat: Handle interupts on PHP7
As https://bugs.php.net/bug.php?id=71448 is not going to get fixed, we need to declare tick
This commit is contained in:
parent
b8474fe0c7
commit
e5f2478b9f
@ -101,6 +101,9 @@ if (empty($options['torun'])) {
|
||||
if (extension_loaded('pcntl')) {
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
if (!in_array('pcntl_signal', $disabled)) {
|
||||
// Handle interrupts on PHP7.
|
||||
declare(ticks = 1);
|
||||
|
||||
pcntl_signal(SIGTERM, "signal_handler");
|
||||
pcntl_signal(SIGINT, "signal_handler");
|
||||
}
|
||||
|
@ -160,6 +160,14 @@ class behat_hooks extends behat_base {
|
||||
if (!empty($CFG->behat_faildump_path) && !is_writable($CFG->behat_faildump_path)) {
|
||||
throw new Exception('You set $CFG->behat_faildump_path to a non-writable directory');
|
||||
}
|
||||
|
||||
// Handle interrupts on PHP7.
|
||||
if (extension_loaded('pcntl')) {
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
if (!in_array('pcntl_signal', $disabled)) {
|
||||
declare(ticks = 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user