diff --git a/src/applications/config/check/PhabricatorPygmentSetupCheck.php b/src/applications/config/check/PhabricatorPygmentSetupCheck.php --- a/src/applications/config/check/PhabricatorPygmentSetupCheck.php +++ b/src/applications/config/check/PhabricatorPygmentSetupCheck.php @@ -34,7 +34,9 @@ ->addRelatedPhabricatorConfig('pygments.enabled') ->addPhabricatorConfig('environment.append-paths'); } else { - list($err) = exec_manual('pygmentize -h'); + list($err, $stdout) = exec_manual('pygmentize -V'); + $version = array(); + preg_match('/\D+(\d\.\d\.\d)\D+\d{4}-\d{4}\D+/', $stdout, $version); if ($err) { $summary = pht( 'You have enabled pygments and the %s script is '. @@ -56,6 +58,27 @@ ->setMessage($message) ->addRelatedPhabricatorConfig('pygments.enabled') ->addPhabricatorConfig('environment.append-paths'); + } else { + if (version_compare($version[1], '2.0.0', '<')) { + $summary = pht( + 'You have enabled pygments and the %s script is '. + 'available.Upgrading pygmentize to version 2.0 '. + 'greater can improve performance in syntax highlighting.'); + + $message = pht( + 'You may want to upgrade %s. '. + 'To upgrade Pygments, visit '. + 'pygments.org and follow the '. + 'download and install instructions.'); + + $this + ->newIssue('pygments.outdated') + ->setName(pht('Outdated %s', 'pygmentize')) + ->setSummary($summary) + ->setMessage($message) + ->addRelatedPhabricatorConfig('pygments.enabled') + ->addPhabricatorConfig('environment.append-paths'); + } } } } else {