Make GeSHi autoloading really work
authorChristian Weiske <cweiske@cweiske.de>
Fri, 25 Aug 2017 05:40:01 +0000 (07:40 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 25 Aug 2017 06:25:10 +0000 (08:25 +0200)
data/config.default.php
src/phorkie/Renderer/Geshi.php
src/phorkie/SetupCheck.php

index 4c3784950e1ff2957007563ed65be3a736144f0c..6e4c20c58219f9772535460d498d7c2610ac1581 100644 (file)
@@ -43,6 +43,7 @@ $GLOBALS['phorkie']['cfg'] = array(
                a paste is created, edited or deleted */
         )
     ),
+    'geshi'         => 'geshi.php',
 );
 $GLOBALS['phorkie']['auth'] = array(
     // 0 = public, no authentication, 1 = protect adds/edits/deletes,
index 2b3854a59d60f746ee5ebe0148ba1be209b7322d..18f95acdba9577a338f57d523117222b9cb1f8f5 100644 (file)
@@ -17,10 +17,10 @@ class Renderer_Geshi
          * Yes, geshi needs to be in your include path
          * We use the geshi pear package.
          */
-        if (!class_exists('\\geshi', true)) {
+        if (!class_exists('\\GeSHi', true)) {
             require_once $GLOBALS['phorkie']['cfg']['geshi'];
         }
-        $geshi = new \geshi($file->getContent(), $this->getType($file));
+        $geshi = new \GeSHi($file->getContent(), $this->getType($file));
         $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
         $geshi->set_header_type(GESHI_HEADER_PRE_TABLE);
         $geshi->enable_classes();
index 9cae724698168e4adf200450db4580d4ca4083ba..36d66c07328f9b952e897099d8c907c2a2b98892 100644 (file)
@@ -74,7 +74,7 @@ class SetupCheck
             }
         }
 
-        if (!class_exists('geshi', true)) {
+        if (!class_exists('GeSHi', true)) {
             $geshi = stream_resolve_include_path(
                 $GLOBALS['phorkie']['cfg']['geshi']
             );