use autoloader on geshi before including it manually
authorChristian Weiske <cweiske@cweiske.de>
Wed, 14 May 2014 16:17:44 +0000 (18:17 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 14 May 2014 16:17:44 +0000 (18:17 +0200)
src/phorkie/Renderer/Geshi.php

index 21d36c2..08c6c74 100644 (file)
@@ -17,7 +17,9 @@ class Renderer_Geshi
          * Yes, geshi needs to be in your include path
          * We use the mediawiki geshi extension package.
          */
-        require_once $GLOBALS['phorkie']['cfg']['geshi'];
+        if (!class_exists('\\GeSHi', true)) {
+            require_once $GLOBALS['phorkie']['cfg']['geshi'];
+        }
         $geshi = new \GeSHi($file->getContent(), $this->getType($file));
         $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
         $geshi->set_header_type(GESHI_HEADER_DIV);