1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-21 22:32:41 +01:00

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
This commit is contained in:
Jakub Vrana 2013-04-07 08:42:59 -07:00
parent 57ad790de3
commit d98401833b

View file

@ -15,6 +15,16 @@ function must_have_extension($ext) {
"install it to run daemons on this machine.\n";
exit(1);
}
$extension = new ReflectionExtension($ext);
foreach ($extension->getFunctions() as $function) {
$function = $function->name;
if (!function_exists($function)) {
echo "ERROR: The PHP function {$function}() is disabled. You must ".
"enable it to run daemons on this machine.\n";
exit(1);
}
}
}
$command = isset($argv[1]) ? $argv[1] : 'help';