Problem identified

straight_up - July 21, 2006 - 18:32
Project:Coolfilter
Version:HEAD
Component:Code
Category:bug report
Priority:critical
Assigned:lllkkk
Status:closed
Description

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.

#1

straight_up - July 21, 2006 - 19:04
Title:Cannot» Update

It appears that this line:

<?php
$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.

#2

straight_up - July 21, 2006 - 19:17
Title:Update» Problem identified
Assigned to:Anonymous» straight_up
Status:active» won't fix

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

<?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:

<?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');
?>

So can this:
<?php
$pear_dir
= "/homepages/12/d56857136/htdocs/ajh/drupal/modules/coolfilter/pear";

require_once(
$pear_dir.'/Text/Highlighter.php');
?>

#3

lllkkk - July 23, 2006 - 10:14
Status: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.

#4

lllkkk - July 23, 2006 - 10:16
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';

#5

lllkkk - February 14, 2007 - 02:30
Assigned to:straight_up» lllkkk
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.