tags:

views:

74

answers:

6

I've got a reference to some function in php code. How to find out in which of included files the function is described?

+2  A: 

I assume that by "described" you mean "defined". For this, you ideally need a decent IDE that can do it.

Anton Gogolev
I'm using Aptana which have text search through project. But to use it I need to import the hole (very large) site as a project.
SaltLake
+4  A: 

If you use an IDE like Netbeans, you can CTRL+Click the function use and it will take you to where it is defined, assuming the file is within the project folder you defined.

There's no code or function to do this though.

Stephen Melrose
Same in Zend Studio and I assume this will work with PDT for Eclipse then as well.
Gordon
+6  A: 

Either use a IDE that allows doing so (I would recomend Eclipse PDT), or you can allways grep it if on Linux, or using wingrep. In Linux it would be something like:

grep -R "function funName" *

from within the root folder of the project.

Johnco
A: 

You'll need an IDE that supports "Open Function Declaration" functionality. A good for for php is Eclipse PDT.

To look for the function definition, highlight the function name, hold CTRL + Click on the name.

Yada
A: 

Just in case, on http://php.net you'll find every standard function.

phresnel
+2  A: 

You could also do this in PHP itself:

$reflFunc = new ReflectionFunction('function_name');
print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();
Tom Haigh
+1 for solving this with PHP instead of the IDE. Nice idea.
Gordon