Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333797 )

Change subject: Make sure $wgPygmentizePath is sane only when we need it
......................................................................

Make sure $wgPygmentizePath is sane only when we need it

This avoids having an extension function, which runs on every request,
regardless of whether it uses syntax highlighting or not.

Change-Id: I890348b73af956819300cce64d0672dcdb209c19
---
M SyntaxHighlight_GeSHi.class.php
M extension.json
2 files changed, 5 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/97/333797/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0a5913d..fc274b6 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -41,15 +41,6 @@
                'text/xml'         => 'xml',
        );
 
-       public static function onSetup() {
-               global $wgPygmentizePath;
-
-               // If $wgPygmentizePath is unset, use the bundled copy.
-               if ( $wgPygmentizePath === false ) {
-                       $wgPygmentizePath = __DIR__ . '/pygments/pygmentize';
-               }
-       }
-
        /**
         * Get the Pygments lexer name for a particular language.
         *
@@ -276,6 +267,11 @@
                $output = $cache->get( $cacheKey );
 
                if ( $output === false ) {
+                       // If $wgPygmentizePath is unset, use the bundled copy.
+                       if ( $wgPygmentizePath === false ) {
+                               $wgPygmentizePath = __DIR__ . 
'/pygments/pygmentize';
+                       }
+
                        $optionPairs = array();
                        foreach ( $options as $k => $v ) {
                                $optionPairs[] = "{$k}={$v}";
diff --git a/extension.json b/extension.json
index eab0d93..062f10e 100644
--- a/extension.json
+++ b/extension.json
@@ -27,9 +27,6 @@
                "SyntaxHighlightAce": "SyntaxHighlight_GeSHi.ace.php",
                "ResourceLoaderGeSHiVisualEditorModule": 
"ResourceLoaderGeSHiVisualEditorModule.php"
        },
-       "ExtensionFunctions": [
-               "SyntaxHighlight_GeSHi::onSetup"
-       ],
        "ResourceFileModulePaths": {
                "localBasePath": "modules",
                "remoteExtPath": "SyntaxHighlight_GeSHi/modules"

-- 
To view, visit https://gerrit.wikimedia.org/r/333797
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I890348b73af956819300cce64d0672dcdb209c19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to