Wiki

Clone wiki

php-project-tree / HowItWorks

How it works?

The application is quite simple. Below you may find the necessary steps to use it at its full capacity.

  1. you start by creating a new (generic) project where two information are essential:
    • PHP project root - the root path of your PHP project that will be used to search for and scan the .php files
    • Project name - a unique project name that will be used to store the file selections/inclusions you make
  2. you select the .php files that make your fileset
    • by selecting/checking a file you may use its icon (on the right side) to analyze its files dependencies
    • by using the Check dependency button it is automatically checked what files are required such that your selected file(s) to work
    • if there are some extra files not selected but required a Fix dependency button will help you to do that automatically; moreover, each file will be colored in yellow so you spot them quickly
  3. To get the big picture of your PHP project source code you may use the Graph button which will draw a graph of files dependencies. By clicking any node of the graph a bird's eye view for that file's dependencies will be shown.
  4. You may even generate and export the list of the selected files by pressing the Export button
  5. Another feature called Autoloader gives you an additional aid by generating a PHP class autoloader file for the included classes

Caveat emptor

In this version it is asserted that any single PHP source file of your PHP project has an unique name. For instance, if you have a file called root/class/my_file.php and another file root/includes/my_file.php the application asserts that these files are the same file. To fix this issue implies a more rigurous code parsing (ie. more enhanced regexp rules) because sometimes you may include a file like this:

$path_variable = '/explicit/path/of/';
define('CLASS_PATH' , $path_variable);
include $path_variable . 'my_file.php';
include '/explicit/path/of/my_file.php';
include CLASS_PATH . 'my_file.php';
and the parser should not only parse this code but also evaluate its meaning. This exceeds the regexp domain and enter more likely in the Lex & Yacc expertise area.

Hopefully it will help you as much as it helps me :-)

Updated