Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorPygmentSetupCheck.php
Show All 36 Lines | if ($pygment) { | ||||
list($err) = exec_manual('pygmentize -h'); | list($err) = exec_manual('pygmentize -h'); | ||||
if ($err) { | if ($err) { | ||||
$summary = pht( | $summary = pht( | ||||
'You have enabled pygments and the %s script is '. | 'You have enabled pygments and the %s script is '. | ||||
'available, but does not seem to work.', | 'available, but does not seem to work.', | ||||
'pygmentize'); | 'pygmentize'); | ||||
$message = pht( | $message = pht( | ||||
'Phabricator has %s available in %s, but the binary '. | 'This server has %s available in %s, but the binary '. | ||||
'exited with an error code when run as %s. Check that it is '. | 'exited with an error code when run as %s. Check that it is '. | ||||
'installed correctly.', | 'installed correctly.', | ||||
phutil_tag('tt', array(), 'pygmentize'), | phutil_tag('tt', array(), 'pygmentize'), | ||||
phutil_tag('tt', array(), '$PATH'), | phutil_tag('tt', array(), '$PATH'), | ||||
phutil_tag('tt', array(), 'pygmentize -h')); | phutil_tag('tt', array(), 'pygmentize -h')); | ||||
$this | $this | ||||
->newIssue('pygments.failed') | ->newIssue('pygments.failed') | ||||
->setName(pht('%s Not Working', 'pygmentize')) | ->setName(pht('%s Not Working', 'pygmentize')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addRelatedPhabricatorConfig('pygments.enabled') | ->addRelatedPhabricatorConfig('pygments.enabled') | ||||
->addPhabricatorConfig('environment.append-paths'); | ->addPhabricatorConfig('environment.append-paths'); | ||||
} | } | ||||
} | } | ||||
} else { | } else { | ||||
$summary = pht( | $summary = pht( | ||||
'Pygments should be installed and enabled '. | 'Pygments should be installed and enabled '. | ||||
'to provide advanced syntax highlighting.'); | 'to provide advanced syntax highlighting.'); | ||||
$message = pht( | $message = pht( | ||||
'Phabricator can highlight a few languages by default, '. | 'This software can highlight a few languages by default, '. | ||||
'but installing and enabling Pygments (a third-party highlighting '. | 'but installing and enabling Pygments (a third-party highlighting '. | ||||
"tool) will add syntax highlighting for many more languages. \n\n". | "tool) will add syntax highlighting for many more languages. \n\n". | ||||
'For instructions on installing and enabling Pygments, see the '. | 'For instructions on installing and enabling Pygments, see the '. | ||||
'%s configuration option.'."\n\n". | '%s configuration option.'."\n\n". | ||||
'If you do not want to install Pygments, you can ignore this issue.', | 'If you do not want to install Pygments, you can ignore this issue.', | ||||
phutil_tag('tt', array(), 'pygments.enabled')); | phutil_tag('tt', array(), 'pygments.enabled')); | ||||
$this | $this | ||||
->newIssue('pygments.noenabled') | ->newIssue('pygments.noenabled') | ||||
->setName(pht('Install Pygments to Improve Syntax Highlighting')) | ->setName(pht('Install Pygments to Improve Syntax Highlighting')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addRelatedPhabricatorConfig('pygments.enabled'); | ->addRelatedPhabricatorConfig('pygments.enabled'); | ||||
} | } | ||||
} | } | ||||
} | } |