A couple of small things:

1) The links point to HEAD, and should probably point to installed version.
2) Links for non-core modules are broken

So the patch...

1) Adds a constant at the top of the module for the current Drupal version and use it in the core module links instead of HEAD
2) For each function in the list, if it's not part of core, it doesn't create a link but just displays the name of the function along with the module and file names. Only works in php5 (uses reflection) but does not break in php4

What do you think about linking to CVS for the module for the non-core functions ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Status: Needs review » Needs work

The D6 version of devel already links to the right version of Drupal. Feel free to backport that and submit a patch. If you are going to do limit this to just core, i think you are better off excluding functions that are in the sites/ tree

pahariwalla’s picture

Lovely... attached is the patch without links to non-core modules.

pahariwalla’s picture

Status: Needs work » Needs review

I neglected to change the status back to "review".

moshe weitzman’s picture

Status: Needs review » Needs work

Does that reflection Function cost anything in terms of performance? Why does the patch mention /modules? Seems like we link unless the code is in /sites.

pahariwalla’s picture

Re: performance -- The average from running microtime() 20 times with and without the patch show that the patch actually runs a little faster ... .07 vs. .09 seconds for the function to execute. I guess that's because it's processing fewer items.

Re: selection of core functions -- You're right about "/modules". It should be exclusive, .i.e not in "/sites" as opposed to must be in "/modules".

Since I'm new to Drupal, so I'm not sure if:

  • non-core modules always live in "/sites/" ?
  • core functions always live in "/modules" or "/includes"?

In testing my installation, I found that all of the functions which not in "/sites" were either in "/modules" or "/includes".

so the new patch has:
$isNotCore = stristr($func->getFileName(), realpath($_SERVER['DOCUMENT_ROOT'] . '/sites')) ? true: false;

instead of the old patch:
$isNotCore = stristr($func->getFileName(),realpath($_SERVER['DOCUMENT_ROOT']) . '/modules') ? false : true;

Thanks for taking the time.

pahariwalla’s picture

Status: Needs work » Needs review

Just wondering what's going on with the patch... just realized I should have changed status to "needs review" ;-)

moshe weitzman’s picture

Status: Needs review » Fixed

Thanks. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.