Permalink
Browse files

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
  • Loading branch information...
1 parent 57ad790 commit d98401833bbc380d203a1136e36a4efffe053dec @vrana vrana committed Apr 7, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 scripts/daemon/phabricator_daemon_launcher.php
View
10 scripts/daemon/phabricator_daemon_launcher.php
@@ -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';

0 comments on commit d984018

Please sign in to comment.