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 4c37849..6e4c20c 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 2b3854a..18f95ac 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 9cae724..36d66c0 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']
             );