public
Description: A combined runtime/static code-analysis tool, that can trace parameter types
Homepage:
Clone URL: git://github.com/troelskn/php-tracer-weaver.git
php-tracer-weaver / trace.sh
100755 23 lines (20 sloc) 0.707 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env sh
print_usage() {
    echo "Traces function signatures in a running PHP script."
    printf "Usage: %s [OPTIONS] PHPSCRIPT\n" $(basename $0)
    echo " PHPSCRIPT A PHP file to analyse"
    echo " OPTIONS The PHP script is launched with these options, verbose"
    echo "Output is written to dumpfile.xt"
    exit 1
}
 
if [ $# -eq 0 ]
then
print_usage
fi;
 
if [ -f dumpfile.xt ]
then
rm dumpfile.xt
fi
 
echo Running script with instrumentation: $@
php -d xdebug.auto_trace=1 -d xdebug.trace_options=1 -d xdebug.trace_output_dir=`pwd` -d xdebug.trace_output_name=dumpfile -d xdebug.trace_format=0 -d xdebug.collect_params=1 -d xdebug.collect_return=1 "$@"
echo "TRACE COMPLETE"