Skip to content

Commit d984018

Browse files
committed
Check presence of required functions in daemon launcher
Summary: I had quite some trouble starting daemons on a machine with installed **pcntl** but with [[ http://www.php.net/ini.core#ini.disable-functions | disabled ]] all functions from it. Test Plan: $ bin/phd start Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5568
1 parent 57ad790 commit d984018

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/daemon/phabricator_daemon_launcher.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ function must_have_extension($ext) {
1515
"install it to run daemons on this machine.\n";
1616
exit(1);
1717
}
18+
19+
$extension = new ReflectionExtension($ext);
20+
foreach ($extension->getFunctions() as $function) {
21+
$function = $function->name;
22+
if (!function_exists($function)) {
23+
echo "ERROR: The PHP function {$function}() is disabled. You must ".
24+
"enable it to run daemons on this machine.\n";
25+
exit(1);
26+
}
27+
}
1828
}
1929

2030
$command = isset($argv[1]) ? $argv[1] : 'help';

0 commit comments

Comments
 (0)