From 9c9ba79b708130c7f8593813504cf356cf09068f Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 25 Aug 2017 07:40:01 +0200 Subject: [PATCH] Make GeSHi autoloading really work --- data/config.default.php | 1 + src/phorkie/Renderer/Geshi.php | 4 ++-- src/phorkie/SetupCheck.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/config.default.php b/data/config.default.php index 4c37849..6e4c20c 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -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, diff --git a/src/phorkie/Renderer/Geshi.php b/src/phorkie/Renderer/Geshi.php index 2b3854a..18f95ac 100644 --- a/src/phorkie/Renderer/Geshi.php +++ b/src/phorkie/Renderer/Geshi.php @@ -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(); diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index 9cae724..36d66c0 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -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'] ); -- 2.30.2