mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02: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:
parent
57ad790de3
commit
d98401833b
1 changed files with 10 additions and 0 deletions
|
@ -15,6 +15,16 @@ function must_have_extension($ext) {
|
||||||
"install it to run daemons on this machine.\n";
|
"install it to run daemons on this machine.\n";
|
||||||
exit(1);
|
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';
|
$command = isset($argv[1]) ? $argv[1] : 'help';
|
||||||
|
|
Loading…
Reference in a new issue