Page MenuHomePhabricator

D14297.id34511.diff
No OneTemporary

D14297.id34511.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,7 @@
->addRelatedPhabricatorConfig('pygments.enabled')
->addPhabricatorConfig('environment.append-paths');
} else {
- list($err) = exec_manual('pygmentize -h');
+ list($err, $stdout) = exec_manual('pygmentize -V');
if ($err) {
$summary = pht(
'You have enabled pygments and the %s script is '.
@@ -56,6 +56,29 @@
->setMessage($message)
->addRelatedPhabricatorConfig('pygments.enabled')
->addPhabricatorConfig('environment.append-paths');
+ } else {
+ if (version_compare($stdout, '2.0.0', '<')) {
+ $summary = pht(
+ 'You have enabled pygments and the %s script is '.
+ 'available. However the pymentize version seems to '.
+ 'be outdated, which gives performance issues.',
+ 'pygmentize');
+
+ $message = pht(
+ 'You may want to upgrade %s. '.
+ 'You can do this by running %s with the %s tag',
+ phutil_tag('tt', array(), 'pygmentize'),
+ phutil_tag('tt', array(), 'pip'),
+ phutil_tag('tt', array(), '--upgrade'));
+
+ $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
Sun, Oct 20, 6:28 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735434
Default Alt Text
D14297.id34511.diff (1 KB)

Event Timeline