Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13979768
D14297.id34511.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14297.id34511.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14297: Switching to pygmentize -V
Attached
Detach File
Event Timeline
Log In to Comment