Skip to content

Commit 5ef32a8

Browse files
committed
Merge branch 'master' into 3.0-merge
# Conflicts: # composer.json # src/testing/co-phpunit
2 parents fea38ed + 6bc2804 commit 5ef32a8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ScanHandler/PcntlScanHandler.php

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515

1616
class PcntlScanHandler implements ScanHandlerInterface
1717
{
18+
public function __construct()
19+
{
20+
if (! extension_loaded('pcntl')) {
21+
throw new Exception('Missing pcntl extension.');
22+
}
23+
if (extension_loaded('grpc')) {
24+
$grpcForkSupport = ini_get_all('grpc')['grpc.enable_fork_support']['local_value'];
25+
$grpcForkSupport = strtolower(trim(str_replace('0', '', $grpcForkSupport)));
26+
if (in_array($grpcForkSupport, ['', 'off', 'false'], true)) {
27+
throw new Exception(' Grpc fork support must be enabled before the server starts, please set grpc.enable_fork_support = 1 in your php.ini.');
28+
}
29+
}
30+
}
31+
1832
public function scan(): Scanned
1933
{
2034
$pid = pcntl_fork();

0 commit comments

Comments
 (0)