1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00

Phabricator now checks whether pygmentize script can be run when user enables pygments

Summary: Check if pygmentize is runnable if pygments is enabled

Test Plan: Enable pygments with pygmentize unavailable in path

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5157
This commit is contained in:
kwadwo 2013-02-28 09:17:01 -08:00 committed by epriestley
parent 1539b21b45
commit 9891394e80
2 changed files with 33 additions and 0 deletions

View file

@ -1286,6 +1286,7 @@ phutil_register_library_map(array(
'PhabricatorSetupCheckMySQL' => 'applications/config/check/PhabricatorSetupCheckMySQL.php', 'PhabricatorSetupCheckMySQL' => 'applications/config/check/PhabricatorSetupCheckMySQL.php',
'PhabricatorSetupCheckPHPConfig' => 'applications/config/check/PhabricatorSetupCheckPHPConfig.php', 'PhabricatorSetupCheckPHPConfig' => 'applications/config/check/PhabricatorSetupCheckPHPConfig.php',
'PhabricatorSetupCheckPath' => 'applications/config/check/PhabricatorSetupCheckPath.php', 'PhabricatorSetupCheckPath' => 'applications/config/check/PhabricatorSetupCheckPath.php',
'PhabricatorSetupCheckPygment' => 'applications/config/check/PhabricatorSetupCheckPygment.php',
'PhabricatorSetupCheckStorage' => 'applications/config/check/PhabricatorSetupCheckStorage.php', 'PhabricatorSetupCheckStorage' => 'applications/config/check/PhabricatorSetupCheckStorage.php',
'PhabricatorSetupCheckTimezone' => 'applications/config/check/PhabricatorSetupCheckTimezone.php', 'PhabricatorSetupCheckTimezone' => 'applications/config/check/PhabricatorSetupCheckTimezone.php',
'PhabricatorSetupIssue' => 'applications/config/issue/PhabricatorSetupIssue.php', 'PhabricatorSetupIssue' => 'applications/config/issue/PhabricatorSetupIssue.php',
@ -2756,6 +2757,7 @@ phutil_register_library_map(array(
'PhabricatorSetupCheckMySQL' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckMySQL' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckPHPConfig' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckPHPConfig' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckPath' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckPath' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckPygment' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckStorage' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckStorage' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckTimezone' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckTimezone' => 'PhabricatorSetupCheck',
'PhabricatorSetupIssueExample' => 'PhabricatorUIExample', 'PhabricatorSetupIssueExample' => 'PhabricatorUIExample',

View file

@ -0,0 +1,31 @@
<?php
final class PhabricatorSetupCheckPygment extends PhabricatorSetupCheck {
protected function executeChecks() {
$pygment = PhabricatorEnv::getEnvConfig('pygments.enabled');
if ($pygment) {
list($err) = exec_manual('pgymentize -h');
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');
}
}
}
}