-
Notifications
You must be signed in to change notification settings - Fork 204
Pfff:PHP
Contents
Follow the installation instructions in install.txt.
To search for PHP code patterns do for instance:
$ ./sgrep -lang php -e 'false !== error_log(...)' /path/to/php/project/
See Sgrep for more information about sgrep.
To visualize a PHP project using pfff_visual you first need to analyze it with pfff_db_light:
$./pfff_db_light -lang php /path/to/php/project/
This should process all files and at the very end ask for confirmation to store the global analysis results in /path/to/php/project/PFFF_DB.db. Enter "y". This global analysis mostly compute the callgraph of the PHP project to determine which functions or methods or classes are the most used, and so are probably the most important. It also stores which functions are taking arguments by reference or which functions are dead, which is leveraged later by the visualizer.
Once the light database has been saved, simply do:
$ ./pfff_visual /path/to/php/project/
The tool will by default look for a PFFF_DB.db file in the directory of the processed project. It should ouput something like
... 317 rectangles to draw Using pfff light db: /path/to/php/project/PFFF_DB.db Using Cairo version: 1.8.10 We got 1791 entities in 243 files ...
You can also use the -with_info option if you decided to store the light database in a non-default location.