mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-21 11:09:02 +01:00
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
This commit is contained in:
parent
796007a85e
commit
f852a09e1c
1 changed files with 37 additions and 12 deletions
|
@ -34,7 +34,31 @@ final class PhabricatorSetupCheckPHPConfig extends PhabricatorSetupCheck {
|
||||||
|
|
||||||
$disable_options = array('disable_functions', 'disable_classes');
|
$disable_options = array('disable_functions', 'disable_classes');
|
||||||
foreach ($disable_options as $disable_option) {
|
foreach ($disable_options as $disable_option) {
|
||||||
if (ini_get($disable_option)) {
|
$disable_value = ini_get($disable_option);
|
||||||
|
if ($disable_value) {
|
||||||
|
|
||||||
|
// By default Debian installs the pcntl extension but disables all of
|
||||||
|
// its functions using configuration. Whitelist disabling these
|
||||||
|
// functions so that Debian PHP works out of the box (we do not need to
|
||||||
|
// call these functions from the web UI). This is pretty ridiculous but
|
||||||
|
// it's not the users' fault and they haven't done anything crazy to
|
||||||
|
// get here, so don't make them pay for Debian's unusual choices.
|
||||||
|
// See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605571
|
||||||
|
$fatal = true;
|
||||||
|
if ($disable_option == 'disable_functions') {
|
||||||
|
$functions = preg_split('/[, ]+/', $disable_value);
|
||||||
|
$functions = array_filter($functions);
|
||||||
|
foreach ($functions as $k => $function) {
|
||||||
|
if (preg_match('/^pcntl_/', $function)) {
|
||||||
|
unset($functions[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$functions) {
|
||||||
|
$fatal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fatal) {
|
||||||
$message = pht(
|
$message = pht(
|
||||||
"You have '%s' enabled in your PHP configuration.\n\n".
|
"You have '%s' enabled in your PHP configuration.\n\n".
|
||||||
"This option is not compatible with Phabricator. Remove ".
|
"This option is not compatible with Phabricator. Remove ".
|
||||||
|
@ -49,6 +73,7 @@ final class PhabricatorSetupCheckPHPConfig extends PhabricatorSetupCheck {
|
||||||
->addPHPConfig($disable_option);
|
->addPHPConfig($disable_option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$open_basedir = ini_get('open_basedir');
|
$open_basedir = ini_get('open_basedir');
|
||||||
if ($open_basedir) {
|
if ($open_basedir) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue