|
|
(Next) API |
||||
| |
|||||
|
|||||
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 the main 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 an API's documentation in HTML, or some PHP code
In addition to xmi, 2 output formats are also available: html, and php. The HTML documentation produced is very similar to a Javadoc API, and offers many navigation possibilities.
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 PHP 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 can automatically convert UML/XMI data from 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 from parsing). You will discover them by asking for help, like this:
$ phpuml -h
|
|
(Next) API |
||||||||
| |
|||||||||
|
|||||||||