From 736857d1f62c2f3d865d14f47cd5e529878aeab0 Mon Sep 17 00:00:00 2001 From: Fabian Stelzer Date: Mon, 29 Dec 2014 09:49:17 -0800 Subject: [PATCH] Setup check to install/enable pygments Summary: Fixes T6533 - actively prompt the user to install and enable pygments Test Plan: uninstalled / disabled pygments and checked setup checks Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6533 Differential Revision: https://secure.phabricator.com/D11048 --- .../check/PhabricatorSetupCheckPygment.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/applications/config/check/PhabricatorSetupCheckPygment.php b/src/applications/config/check/PhabricatorSetupCheckPygment.php index b1bad2a853..81515fc6cc 100644 --- a/src/applications/config/check/PhabricatorSetupCheckPygment.php +++ b/src/applications/config/check/PhabricatorSetupCheckPygment.php @@ -3,7 +3,6 @@ final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck { protected function executeChecks() { - $pygment = PhabricatorEnv::getEnvConfig('pygments.enabled'); if ($pygment) { @@ -47,6 +46,24 @@ final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck { ->addPhabricatorConfig('environment.append-paths'); } } + } else { + $summary = pht('Pygments should be installed and enabled '. + 'to provide advanced syntax highlighting.'); + + $message = pht('Phabricator can highlight a few languages by default, '. + 'but installing and enabling Pygments (a third-party highlighting '. + 'tool) will add syntax highlighting for many more languages. '."\n\n". + 'For instructions on installing and enabling Pygments, see the '. + '%s configuration option.'."\n\n". + 'If you do not want to install Pygments, you can ignore this issue.', + phutil_tag('tt', array(), 'pygments.enabled')); + + $this + ->newIssue('pygments.noenabled') + ->setName(pht('Install Pygments to Improve Syntax Highlighting')) + ->setSummary($summary) + ->setMessage($message) + ->addRelatedPhabricatorConfig('pygments.enabled'); } } }