Add option 'argument_functions' that tracks arguments of whitelisted set of functions.
Arguments are added behind # after the function call itself.
Several php internal methods have special handling for tracking arguments:
PDOStatement::execute if tracked will contain the SQL query.
curl_exec if tracked will contain the called URL
A big set of stream related functions will contain the opened file (independent of stream type): fgets, fread, fputs, fwrite, fgetcsv, stream_get_contents if there is one.
Compiling this patch is tricky because of the curl dependency. You need to copy the file ext/curl/php_curl.h from the PHP-src to your include folder, for example /usr/include/php/ext/curl/php_curl.h. PHP does not expose php_curl.h by default, the header is only necessary because we need to access the struct php_curl for accessing the effective URL during curl_exec calls.
This is only tested with PHP 5.4.31 and 5.5.15 at the moment.
This patch is based on work by Syseleven (https://github.com/syseleven/xhprof) and adds the following functionality to XHProf:
Compiling this patch is tricky because of the curl dependency. You need to copy the file
ext/curl/php_curl.h
from the PHP-src to your include folder, for example/usr/include/php/ext/curl/php_curl.h
. PHP does not expose php_curl.h by default, the header is only necessary because we need to access the structphp_curl
for accessing the effective URL duringcurl_exec
calls.This is only tested with PHP 5.4.31 and 5.5.15 at the moment.
Example: https://gist.github.com/beberlei/231fa0f97e868d2ea97e