I'd like to help implement a new PHP procedure wrote called PHP Variable Hunter (in Sandbox). It specifically searches for array members containing ‘needle’, more precisely than dpm or krumo. It does the hunting for you

Use it like this:

$results = pvh($arraytosearch, ‘needle’, TRUE); // last parm is optional; specifies exact match (default FALSE). $results is also optional.

It looks through the array tree structure for the needle and prints the results to the screen like this:

$ArraySearch[content][leader][leader_first]->block_7[#contextual_links][block][1]; == block

Results are in exact PHP format, with object references included.

For debug sessions the array $results contains the variables in the array, so developers can find and examine the array without leaving the debug session.

- I’m asking if you want this routine added to the debug module. It is not Drupal version specific.

Sandbox location: https://drupal.org/sandbox/jeoware/2023153

I'll assist implementation.

CommentFileSizeAuthor
Variable_Hunter.png88.17 KBjeoware

Comments

salvis’s picture

Status: Needs work » Active

Duplicate closed: #2061317: Add phpvariable_hunter
Please don't do this.

Thank you for your offer, but I don't think this is a must-have.

jeoware’s picture

Thanks for considering it. pvh() has really showed me how many duplicated entries there are in variable trees, perhaps a sign of bad design. Anyway, I'll spread the word outside of the devel module.

willzyx’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing for lack of activity. Feel free to reopen if the issue still exists