2013-02-28 18:17:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck {
|
|
|
|
|
|
|
|
protected function executeChecks() {
|
|
|
|
|
|
|
|
$pygment = PhabricatorEnv::getEnvConfig('pygments.enabled');
|
|
|
|
|
|
|
|
if ($pygment) {
|
2013-02-28 19:46:04 +01:00
|
|
|
list($err) = exec_manual('pygmentize -h');
|
2013-02-28 18:17:01 +01:00
|
|
|
if ($err) {
|
|
|
|
$summary = pht(
|
|
|
|
'You enabled pygments but the pygmentize script is not '.
|
|
|
|
'actually available, your $PATH is probably broken.');
|
|
|
|
|
|
|
|
$message = pht(
|
|
|
|
'The environmental variable $PATH does not contain '.
|
|
|
|
'pygmentize. You have enabled pygments, which requires '.
|
|
|
|
'pygmentize to be available in your $PATH variable.');
|
|
|
|
|
|
|
|
$this
|
|
|
|
->newIssue('pygments.enabled')
|
|
|
|
->setName(pht('pygmentize Not Found'))
|
|
|
|
->setSummary($summary)
|
|
|
|
->setMessage($message)
|
|
|
|
->addPhabricatorConfig('pygments.enabled')
|
|
|
|
->addPhabricatorConfig('envinronment.append-paths');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|