Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13974537
D14297.id34768.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.id34768.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,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
Details
Attached
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)
Attached To
Mode
D14297: Switching to pygmentize -V
Attached
Detach File
Event Timeline
Log In to Comment