The executable phpuml relies on Console::CommandLine. If you have followed the normal PEAR installation process to install PHP_UML, that dependency should have been resolved, and you should be able to run phpuml directly from the command line.
Pass the files and/or the directories to parse as arguments:
$ phpuml /var/www/foo
Separate the different elements by a space:
$ phpuml /var/www/file1.php file2.php
By default, phpuml will recursively parse the specified files/folders, and will echo the XMI code on the screen (UML/XMI version 2).
Renaming the UML model name
By default, the root package of a UML model is named default. To rename it, use the option -n:
$ phpuml /var/www/foo -n MyProject
Saving to a file
To save the XMI data in a particular place, instead of printing it on the screen, use -o:
$ phpuml /var/www/foo -n MyProject -o /var/tmp/
The option -o also accepts a file name, instead of a directory path.
Generating PHP code or HTML API documentation
In addition to xmi, 2 output formats are also available: html, and php. They work by applying an XSL transformation to the XMI data (in UML version 2).
Use the option -f to specify which format you want phpuml to generate.
$ phpuml /var/www/foo -f html -o /var/tmp/
If you need to provide your own XMI file, instead of parsing existing files, simply pass it as argument.
$ phpuml myFile.xmi -f php -o /var/tmp/
Selecting the UML/XMI version
To select which version of the UML/XMI standards you want your XMI to be written in, use the option -x:
$ phpuml /var/www/foo -x 1 -o /var/tmp/
Converting from UML/XMI version 1 to 2
phpuml automatically converts UML/XMI data in version 1.4 to version 2.1.
$ phpuml foo1.xmi -o foo2.xmi
Filtering the files to parse
By default, phpuml will parse only files with the extension .php. To modify this file pattern, use the - m selector:
$ phpuml /var/www/foo -m *.php *.txt
Other options are available (like an option to exclude certain files or directories to parse). You will discover them all by asking for help, like this:
$ phpuml -h