I used the package from the author's site, which includes the required PEAR packages.

This code:

[coolcode lang="php"]
...
[/coolcode]

Generates the following error:

Fatal error: Call to undefined method PEAR_Error::highlight() in /homepages/12/d95635462/htdocs/ajh/drupal/modules/coolfilter/coolcode.php on line 226

Omitting a lang="" attribute WORKS FINE but obviously does not highlight the code as PHP syntax.

Comments

straight_up’s picture

Title: Cannot » Update

It appears that this line:

$hl =& Text_Highlighter::factory($lang, $options);

causes $hl to be set to PEAR_Error. In other words, somethings is wrong with either the settings passed to factory(), or within Text/Highligher.php.

straight_up’s picture

Title: Update » Problem identified
Assigned: Unassigned » straight_up
Status: Active » Closed (won't fix)

This can happen when you change any of the following lines in coolcode.php:

$pear_dir = "/homepages/12/d56857136/htdocs/ajh/drupal/modules/coolfilter/pear";

if(is_dir($pear_dir))
    ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . $pear_dir);

require_once('Text/Highlighter.php');

This is because Text/Hightlight.php also needs to include files, so include_path needs set.

This can cause problems:

$pear_dir = "/homepages/12/d56857136/htdocs/ajh/drupal/modules/coolfilter/pear";

if(is_dir($pear_dir))
    ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . $pear_dir);

require_once('/Text/Highlighter.php');

So can this:

$pear_dir = "/homepages/12/d56857136/htdocs/ajh/drupal/modules/coolfilter/pear";

require_once($pear_dir.'/Text/Highlighter.php');
lllkkk’s picture

Status: Closed (won't fix) » Needs review

I have tesed it on two different servers (one clean Install drupal & coolfilter), all of them have No Problem.
Please read doc on http://www.kylinx.net/node/118 carefully, it module needs an INSTALLATION, before you use it.

lllkkk’s picture

Status: Needs review » Active

code like this is right.

$pear_dir = "/var/www/localhost/htdocs/drupal/modules/coolfilter/pear";
if(is_dir($pear_dir))
    ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . $pear_dir);
require_once 'Text/Highlighter.php';
lllkkk’s picture

Assigned: straight_up » lllkkk
Status: Active » Closed (fixed)