Page MenuHomePhabricator

D14297.id34768.diff
No OneTemporary

D14297.id34768.diff

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 {

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 19, 6:04 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730675
Default Alt Text
D14297.id34768.diff (1 KB)

Event Timeline