use geshi from geshi's new pear channel
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 13 Jun 2014 08:07:24 +0000 (10:07 +0200)
committerChristian Weiske <christian.weiske@netresearch.de>
Fri, 13 Jun 2014 08:07:24 +0000 (10:07 +0200)
README.rst
data/config.default.php
src/phorkie/Renderer/Geshi.php
src/phorkie/SetupCheck.php

index 1270c30..043c438 100644 (file)
@@ -98,8 +98,8 @@ on your machine:
   $ pear channel-discover pear.twig-project.org
   $ pear install twig/Twig
 
-  $ pear channel-discover mediawiki.googlecode.com/svn
-  $ pear install mediawiki/geshi
+  $ pear channel-discover pear.geshi.org
+  $ pear install geshi/geshi
 
   $ pear channel-discover zustellzentrum.cweiske.de
   $ pear install zz/mime_type_plaindetect-alpha
@@ -110,11 +110,6 @@ on your machine:
   $ pear channel-discover pear2.php.net
   $ pear install pear2/pear2_services_linkback-alpha
 
-Note that this version of GeSHi is a bit outdated, but it's the fastest
-way to install it.
-If you install it manually be sure to update the
-path from ``data/config.default.php``.
-
 
 ======
 Search
index 8f796f4..2beb354 100644 (file)
@@ -12,7 +12,6 @@ $GLOBALS['phorkie']['cfg'] = array(
     'topbar'        => '',
     'setupcheck'    => true,
     'elasticsearch' => null,
-    'geshi'         => 'MediaWiki/geshi/geshi/geshi.php',
     'index'         => 'new',//"new" or "list"
     'perPage'       => 10,
     'defaultListPage' => 'last',//a number or "last"
index 08c6c74..9cb15a2 100644 (file)
@@ -13,12 +13,8 @@ class Renderer_Geshi
      */
     public function toHtml(File $file, Tool_Result $res = null)
     {
-        /**
-         * Yes, geshi needs to be in your include path
-         * We use the mediawiki geshi extension package.
-         */
         if (!class_exists('\\GeSHi', true)) {
-            require_once $GLOBALS['phorkie']['cfg']['geshi'];
+            require_once 'geshi.php';
         }
         $geshi = new \GeSHi($file->getContent(), $this->getType($file));
         $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
index 53e4fd0..fbc99c7 100644 (file)
@@ -47,11 +47,9 @@ class SetupCheck
         }
 
         if (!class_exists('GeSHi', true)) {
-            $geshi = stream_resolve_include_path(
-                $GLOBALS['phorkie']['cfg']['geshi']
-            );
-            if ($geshi === false) {
-                $this->fail('GeSHi not available');
+            @include_once 'geshi.php';
+            if (!class_exists('GeSHi', false)) {
+                $this->fail('PEAR package not installed: pear.geshi.org/geshi');
             }
         }