From ce14338081e189cb28b7ac6088dfadbd7429c33b Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 7 Oct 2016 08:07:15 -0700 Subject: [PATCH] When setup issues raise opcache configuration errors, point at the opcache configuration page Summary: Fixes T11746. The opcache docs are on a different page, so point there if we're raising opcache issues. (It's possible for a setup issue to say "configure X, or configure Y", where X is opcache and Y is non-opcache, so we may want to render both links.) Test Plan: {F1867109} Reviewers: chad Reviewed By: chad Maniphest Tasks: T11746 Differential Revision: https://secure.phabricator.com/D16685 --- .../config/view/PhabricatorSetupIssueView.php | 55 ++++++++++++++----- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index ca6397133d..d2e5a6c281 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -404,19 +404,48 @@ final class PhabricatorSetupIssueView extends AphrontView { implode("\n", $more_loc)); } - $info[] = phutil_tag( - 'p', - array(), - pht( - 'You can find more information about PHP configuration values in the '. - '%s.', - phutil_tag( - 'a', - array( - 'href' => 'http://php.net/manual/ini.list.php', - 'target' => '_blank', - ), - pht('PHP Documentation')))); + $show_standard = false; + $show_opcache = false; + + foreach ($configs as $key) { + if (preg_match('/^opcache\./', $key)) { + $show_opcache = true; + } else { + $show_standard = true; + } + } + + if ($show_standard) { + $info[] = phutil_tag( + 'p', + array(), + pht( + 'You can find more information about PHP configuration values '. + 'in the %s.', + phutil_tag( + 'a', + array( + 'href' => 'http://php.net/manual/ini.list.php', + 'target' => '_blank', + ), + pht('PHP Documentation')))); + } + + if ($show_opcache) { + $info[] = phutil_tag( + 'p', + array(), + pht( + 'You can find more information about configuring OPCache in '. + 'the %s.', + phutil_tag( + 'a', + array( + 'href' => 'http://php.net/manual/opcache.configuration.php', + 'target' => '_blank', + ), + pht('PHP OPCache Documentation')))); + } $info[] = phutil_tag( 'p',