Hello,
in devel.module the FirePHPCore is included.

      $path = './'. drupal_get_path('module', 'devel') .'/FirePHPCore/lib/FirePHPCore/fb.php';
      if (file_exists($path)) {
        include_once $path;
      }

Could this be changed to check if whether FirePHP is available in the PEAR-directory?

Kind regards

Comments

chop’s picture

You could accomplish the PEAR package include check being requested by @con1e with the following code:

// Include FirePHP
$includepath = ini_get('include_path');
$no_pear = TRUE;

if (substr(PHP_OS, 0, 3) == 'WIN') {
  $delim = ';';
}
else {
  $delim = ':';
}

foreach(explode($delim, $includepath) as $p) {
  $testpath = realpath($p) .'/FirePHPCore/fb.php';
  if (file_exists($testpath)) {
    include 'FirePHPCore/FirePHP.class.php';
    $no_pear = FALSE;
    break;
  }
}

if ($no_pear) {
  $path = './'. drupal_get_path('module', 'devel') .'/FirePHPCore/lib/FirePHPCore/fb.php';
  if (file_exists($path)) {
    include $path;
  }
}

I hope that this might help.

OnkelTem’s picture

Title: Include FirePHP from PEAR? » Devel is unable to include FirePHP as PEAR package correctly
Version: 6.x-1.x-dev » 7.x-1.0
Category: feature » bug
Priority: Minor » Normal
Status: Active » Needs review
StatusFileSize
new523 bytes

Very simple patch

UPD. Patch is wrong, see the next comment

OnkelTem’s picture

StatusFileSize
new639 bytes

--

salvis’s picture

Status: Needs review » Closed (duplicate)

According to the current code it takes two includes for FirePHP.

Please join us in #1038194: Undefined variable: firephp_path chromephp_path in devel_init and use the latest -dev version as a base for patches.