I would like to run the following test on my PHP files.
I have 2 PHP functions called: iterate and display
here are the function signatures:
Code: Select all
public function iterate($param1, $param2, $param3 = '');
function display($param1, $param2, $param3 = '');I would like to know exactly where I am using these functions in the code and what parameters are being used.
I would like to write a script that will iterate over all the PHP files (.php or .inc.php extension) in my projet and to use a regular expression to look for usage of these functions.
Whenever a usage is encountered, it should be written to a log file like so:
<$param1>\t<$param2>\t<path to file>\t<line #>\n
For example, if file a.php contains the code:
Code: Select all
echo display('test', 'Hello');Code: Select all
if ($obj->iterate('run', $val) == true)) {Code: Select all
test Hello a.php 14
run $val b.php 20I was wondering if someone could help me with this as my main problem is how to formulate the regular expression
regards