Download
We distribute a PHP Archive (PHAR) that contains all required dependencies of UmlWriter bundled in a single file.
Make it executable, and put it into your $PATH
.
$ chmod +x umlwriter-1.2.0.phar
$ mv umlwriter-1.2.0.phar /usr/local/bin/umlwriter
$ umlwriter --version
You can also immediately use the PHAR after you have downloaded it.
$ wget http://bartlett.laurent-laville.org/get/umlwriter-1.2.0.phar
$ php umlwriter-1.2.0.phar --version
With both methods then you have this output :
umlWriter version 1.2.0
See other alternatives in User Guide to install UmlWriter
Generating a Diagram
UML diagrams produced, may be either :
-
restricted to a simple class and its direct dependencies.
-
restricted to a single namespace (with all its objects).
-
non-restricted (all namespaces and their objects).
The following diagram processors (output formats) are available:
-
Graphviz syntax with HTML-like labels
-
PlantUML syntax with default fonts and colors
The following reverse-engines are supported:
-
Bartlett\Reflect (default in CLI mode)
Generating a diagram statements from a Terminal
-
In graphviz format with
bartlett/php-reflect
reverse-engine$ umlwriter diagram:render --reflector=reflect --processor=graphviz /path/to/data_source
-
In graphviz format with
andrewsville/php-token-reflection
reverse-engine$ umlwriter diagram:render --reflector=tokenreflection --processor=graphviz /path/to/data_source
-
In plantuml format with default reverse-engine (
bartlett/php-reflect
)$ umlwriter diagram:render --processor=plantuml /path/to/data_source
Generating a diagram image
-
With Graphviz and
png
output format$ dot -Tpng -O /path/to/gv_file
Where
/path/to/gv_file
is a file contening Graphviz syntax statements produced by the umlwriter command. -
With PlantUML and
png
output format$ java -jar plantuml.jar -Tpng /path/to/puml_file -o /path/to/ouput/dir
Where
/path/to/puml_file
is a file contening PlantUML syntax statements produced by the umlwriter command.And
/path/to/output/dir
is the directory where the image will be generated.
Summary
Let’s review what we’ve done :
-
downloaded the latest stable PHAR version.
-
created project using Composer.
-
built your first graphviz and plantuml UML diagram (and
png
image) from any data source.
Next
Choose your way depending of your skill level.