3 final class PhabricatorPygmentSetupCheck
extends PhabricatorSetupCheck
{
5 public function getDefaultGroup() {
6 return self
::GROUP_OTHER
;
9 protected function executeChecks() {
10 $pygment = PhabricatorEnv
::getEnvConfig('pygments.enabled');
13 if (!Filesystem
::binaryExists('pygmentize')) {
15 'You enabled pygments but the %s script is not '.
16 'actually available, your %s is probably broken.',
21 'The environmental variable %s does not contain %s. '.
22 'You have enabled pygments, which requires '.
23 '%s to be available in your %s variable.',
30 ->newIssue('pygments.enabled')
31 ->setName(pht('%s Not Found', 'pygmentize'))
32 ->setSummary($summary)
33 ->setMessage($message)
34 ->addRelatedPhabricatorConfig('pygments.enabled')
35 ->addPhabricatorConfig('environment.append-paths');
37 list($err) = exec_manual('pygmentize -h');
40 'You have enabled pygments and the %s script is '.
41 'available, but does not seem to work.',
45 'This server has %s available in %s, but the binary '.
46 'exited with an error code when run as %s. Check that it is '.
47 'installed correctly.',
48 phutil_tag('tt', array(), 'pygmentize'),
49 phutil_tag('tt', array(), '$PATH'),
50 phutil_tag('tt', array(), 'pygmentize -h'));
53 ->newIssue('pygments.failed')
54 ->setName(pht('%s Not Working', 'pygmentize'))
55 ->setSummary($summary)
56 ->setMessage($message)
57 ->addRelatedPhabricatorConfig('pygments.enabled')
58 ->addPhabricatorConfig('environment.append-paths');
63 'Pygments should be installed and enabled '.
64 'to provide advanced syntax highlighting.');
67 'This software can highlight a few languages by default, '.
68 'but installing and enabling Pygments (a third-party highlighting '.
69 "tool) will add syntax highlighting for many more languages. \n\n".
70 'For instructions on installing and enabling Pygments, see the '.
71 '%s configuration option.'."\n\n".
72 'If you do not want to install Pygments, you can ignore this issue.',
73 phutil_tag('tt', array(), 'pygments.enabled'));
76 ->newIssue('pygments.noenabled')
77 ->setName(pht('Install Pygments to Improve Syntax Highlighting'))
78 ->setSummary($summary)
79 ->setMessage($message)
80 ->addRelatedPhabricatorConfig('pygments.enabled');