In functions dcp() and devel_watchdog(), devel.module checks for class existence for ChromePHP and FirePHP respectively by using class_exists() with only one parameter. This causes autoload implementation to trigger uselessly for theses classes. The second parameter should be passed as FALSE to avoid triggering autoload.

CommentFileSizeAuthor
#2 class_exists_no_autoload-1212658-2.patch813 bytesfgm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salvis’s picture

Patch for D8/D7?

fgm’s picture

Version: 6.x-1.x-dev » 8.x-1.x-dev
Status: Active » Needs review
FileSize
813 bytes

Patch for D8. Will need backport afterwards.

salvis’s picture

Version: 8.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to D8/D7, thanks!

Patch for D6?

pcambra’s picture

Issue tags: +develcontribute

Tagging

mr.baileys’s picture

Version: 6.x-1.x-dev » 8.x-1.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Active

I found this issue when I was about to log the presence of autoload = FALSE in dcp() as a bug in the devel issue queue: I'm using Composer Manager to install ChromePhp (all on D7), expecting everything to just work, but the only way I can make it work is by patching devel to get rid of the autoload = FALSE in the class_exists().

Seems like a bug to me since even though ChromePhp is installed and I can call ChromePhp::log() from anywhere in my code, devel refuses to use it unless I patch it.

is there a noticeable performance penalty to leaving autoloading enabled in these class_exists() calls?

lussoluca’s picture

Status: Active » Closed (fixed)

In #2191395: Make dpm() and friends pluggable (with Krumo, Kint, Ladybug etc) the second parameter of class_exists has been set to FALSE.

lussoluca’s picture

Status: Closed (fixed) » Fixed
willzyx’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

Moving to 7.x

willzyx’s picture

Status: Patch (to be ported) » Closed (works as designed)

Looks like dcp() in 7.x branch already contains this fix. Sorry :P
The 6.x doesn't contains the fix but Drupal 6 is no longer supported so i'm closing this issue