@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Whitelist blacklisting pcntl_ functions for setup checks so Debian installs don't fatal instantly

Summary: See IRC. This is dumb but I think we should try to work by default on Debian, and it doesn't cost us too much. See inline comment for more.

Test Plan:
- No `disable_functions`, restarted, worked fine.
- Set `disable_functions = pcntl_derp`, restarted, worked fine.
- Set `disable_functions = derp`, restarted, setup fatal.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6741

+37 -12
+37 -12
src/applications/config/check/PhabricatorSetupCheckPHPConfig.php
··· 34 34 35 35 $disable_options = array('disable_functions', 'disable_classes'); 36 36 foreach ($disable_options as $disable_option) { 37 - if (ini_get($disable_option)) { 38 - $message = pht( 39 - "You have '%s' enabled in your PHP configuration.\n\n". 40 - "This option is not compatible with Phabricator. Remove ". 41 - "'%s' from your configuration to continue.", 42 - $disable_option, 43 - $disable_option); 37 + $disable_value = ini_get($disable_option); 38 + if ($disable_value) { 39 + 40 + // By default Debian installs the pcntl extension but disables all of 41 + // its functions using configuration. Whitelist disabling these 42 + // functions so that Debian PHP works out of the box (we do not need to 43 + // call these functions from the web UI). This is pretty ridiculous but 44 + // it's not the users' fault and they haven't done anything crazy to 45 + // get here, so don't make them pay for Debian's unusual choices. 46 + // See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605571 47 + $fatal = true; 48 + if ($disable_option == 'disable_functions') { 49 + $functions = preg_split('/[, ]+/', $disable_value); 50 + $functions = array_filter($functions); 51 + foreach ($functions as $k => $function) { 52 + if (preg_match('/^pcntl_/', $function)) { 53 + unset($functions[$k]); 54 + } 55 + } 56 + if (!$functions) { 57 + $fatal = false; 58 + } 59 + } 60 + 61 + if ($fatal) { 62 + $message = pht( 63 + "You have '%s' enabled in your PHP configuration.\n\n". 64 + "This option is not compatible with Phabricator. Remove ". 65 + "'%s' from your configuration to continue.", 66 + $disable_option, 67 + $disable_option); 44 68 45 - $this->newIssue('php.'.$disable_option) 46 - ->setIsFatal(true) 47 - ->setName(pht('Remove PHP %s', $disable_option)) 48 - ->setMessage($message) 49 - ->addPHPConfig($disable_option); 69 + $this->newIssue('php.'.$disable_option) 70 + ->setIsFatal(true) 71 + ->setName(pht('Remove PHP %s', $disable_option)) 72 + ->setMessage($message) 73 + ->addPHPConfig($disable_option); 74 + } 50 75 } 51 76 } 52 77