svn: /pear/peardoc/trunk/en/package/php/php-uml/ about-the-parser.xml api.xml command-line.xml conversion-rules.xml extension.xml intro.xml
[email protected] (Baptiste Autin)
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <[email protected]> |
baptiste750 Tue, 15 Dec 2009 01:31:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292146
Log:
Updated all pages to reflect the changes of the version 1.5 of PHP_UML
Changed paths:
A pear/peardoc/trunk/en/package/php/php-uml/about-the-parser.xml
U pear/peardoc/trunk/en/package/php/php-uml/api.xml
U pear/peardoc/trunk/en/package/php/php-uml/command-line.xml
D pear/peardoc/trunk/en/package/php/php-uml/conversion-rules.xml
A pear/peardoc/trunk/en/package/php/php-uml/extension.xml
U pear/peardoc/trunk/en/package/php/php-uml/intro.xml
svn-diffs-292146.txt
(text/x-diff, 26.7 KB)
Added: pear/peardoc/trunk/en/package/php/php-uml/about-the-parser.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/about-the-parser.xml (rev 0)
+++ pear/peardoc/trunk/en/package/php/php-uml/about-the-parser.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.php.php-uml.about-the-parser">
+ <refnamediv>
+ <refname>About the parser</refname>
+ <refpurpose>Things to know about how PHP_UML parses PHP code</refpurpose>
+ </refnamediv>
+
+ <refsection><info><title>Types</title></info>
+ <para>
+ Even though PHP is not a "strong typed language", PHP_UML relies a set of predefined types (integer, float, string, mixed, etc.) and tries to use
+ them as much as it can guess. By inspecting the default values, the type hints in the functions parameters (when they are present), as well as the
+ docblocks @param, PHP_UML can detect the types of the parameters, constants and properties. When it cannot guess, it assumes that it is the <emphasis>mixed</emphasis> type.
+ </para>
+ <para>PHP_UML is also aware of a couple of internal PHP classifiers, such as Exception or Iterator (that's why you might see them appear in the API
+ documentation).
+ </para>
+ <para>What happens if the parser has not been able to resolve a type/class/interface? (for example, when a class implements an interface whose source code has not been provided)
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ With the export formats <emphasis>xmi</emphasis> and <emphasis>html</emphasis>, the target type does not appear at all.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ With the export format <emphasis>htmlnew</emphasis>, the type is displayed, but is not clickable.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </refsection>
+
+ <refsection><info><title>Packages and namespaces </title></info>
+ <para>Even if packages don't exist by themselves in PHP, PHP_UML reconstitutes them by using the PHP namespaces (from PHP 5.3), or by using
+ the docblock @package (if the source code has some).
+ As for the "top package", it is nothing else than the "global namespace" of PHP.
+ </para>
+ </refsection>
+
+ <refsection><info><title>Procedural code</title></info>
+ <para>Although this is not very UML style, PHP_UML can parse procedural code. The output format <emphasis>htmlnew</emphasis> is currently the only format
+ to benefit from this new capability (the XMI format cannot, since it is a strict object-oriented XML vocabulary).</para>
+ <para>In the API documentation, the procedural functions will appear under <emphasis>Functions</emphasis> and the procedural constants under <emphasis>Properties</emphasis>, inside the
+ package that matches the namespace that these elements belong to.</para>
+ </refsection>
+
+ <refsection><info><title>Special switches</title></info>
+ <para>By default, the parser will ignore all the elements that have a docblock @internal. If you want to have them parsed anyway, use the switch --show-internal</para>
+ <para>Similarly, the switch --only-api forces PHP_UML to parse only the elements that are annotated with an @api.</para>
+ <para>With the switch --no-dollar, the parser removes the $ at the beginning of the property names (this character can cause problems with some UML tools).</para>
+ <para>Set the error reporting level to 2 with "--error-level 2" to display a list of the types/classes/interfaces that PHP_UML has not been able to resolve.</para>
+ </refsection>
+
+ <refsection><info><title>How do PHP elements map to UML concepts? (logical view)</title></info>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A PHP class (or interface) maps to an UML Class (or Interface).
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A PHP function maps to an UML Operation.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A PHP property, or class constant, maps to an UML Attribute.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Packages do not exist in PHP, like they do in Java. There are two possible ways to mimic them:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ by using the PHP <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.php.net/manual/en/language.namespaces.php">namespace</link> instruction
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ by using the docblock <literal>@package</literal> in the comment of a class (or of a file)
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ Note that the <literal>namespace</literal> and <literal>use</literal> instructions will be parsed only if you run PHP_UML with PHP from version 5.3.
+ </para>
+ </refsection>
+
+ <refsection><info><title>How do PHP elements map to UML concepts? (deployment view)</title></info>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A PHP file maps to an UML Artifact.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A physical folder maps to an UML Package.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </refsection>
+
+ <refsection><info><title>How do PHP elements map to UML concepts? (component view)</title></info>
+ <para>
+ In UML 1.4:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A class (or an interface) maps to an UML Component.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A logical package maps to an UML Subpackage.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ In UML 2.1:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A class (or an interface) maps to an UML Component.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A logical package maps to a nesting UML Component.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </refsection>
+
+</refentry>
Modified: pear/peardoc/trunk/en/package/php/php-uml/api.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/api.xml 2009-12-15 00:37:43 UTC (rev 292145)
+++ pear/peardoc/trunk/en/package/php/php-uml/api.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -6,17 +6,17 @@
</refnamediv>
<refsection><info><title>Principles</title></info>
- <para><literal>PHP_UML</literal> is structured in 5 packages:</para>
+ <para><literal>PHP_UML</literal> is structured in 4 packages:</para>
<para>
<itemizedlist>
<listitem>
<simpara>
- The main package, which contains the main class (<literal>PHP_UML</literal>) and some utility classes
+ The host package, which contains the main class (<literal>PHP_UML</literal>) and some utility classes
</simpara>
</listitem>
<listitem>
<simpara>
- The <literal>PHP</literal> package, where the PHP parser resides
+ The <literal>Input</literal> package, where the PHP parser resides
</simpara>
</listitem>
<listitem>
@@ -24,21 +24,16 @@
The <literal>Metamodel</literal> package, which contains the data structures that <literal>PHP_UML</literal> is using to modelize the code parsed
</simpara>
</listitem>
- <listitem>
- <simpara>
- The <literal>XMI</literal> package, which contains classes that can serialize a metamodel into XMI code
- </simpara>
- </listitem>
<listitem>
<simpara>
- The <literal>Output</literal> package, which contains all the stuff to transform XMI into another format (like HTML)
+ The <literal>Output</literal> package, which contains all the stuff to transform a metamodel stored into memory into an output format (like XMI, HTML, or PHP)
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
- But the only class you need to know about is <literal>PHP_UML</literal>.
- Since the first release of the package, the API of that class has changed a little bit, and you will find several methods doing more or less the same job.
+ Unless you want to develop your own output format, the only single class you need to know about is <literal>PHP_UML</literal>.
+ Since the first release of PHP_UML, the API of that class has changed, and you might find several methods doing more or less the same job.
</para>
</refsection>
@@ -60,9 +55,7 @@
]]>
</programlisting>
</example>
- <para>
- Note that, since UML is a strong object-oriented standard, <classname>PHP_UML</classname> ignores all global functions, or global constants.
- </para>
+
<example><info><title>Parsing of two directories, ignoring the <filename>CSV</filename> folders, and generation of HTML documentation</title></info>
<programlisting role="php">
@@ -73,14 +66,13 @@
$uml = new PHP_UML();
$uml->setInput(array('C:\Inetpub\foo', 'C:\Inetpub\libraries'));
$uml->parse();
-$uml->generateXMI(2);
$uml->export('html', 'C:\Inetpub\api');
?>
]]>
</programlisting>
</example>
-<example><info><title>Import of a XMI file, and generation of PHP code templates</title></info>
+<example><info><title>Import of an XMI file, and generation of PHP code templates</title></info>
<programlisting role="php">
<![CDATA[
@@ -88,7 +80,7 @@
require_once 'PHP/UML.php';
$uml = new PHP_UML();
-$uml->readXMIFile('foo.xmi');
+$uml->xmiExporter->readXMIFile('foo.xmi');
$uml->export('php', 'C:\Inetpub\foo');
?>
]]>
Modified: pear/peardoc/trunk/en/package/php/php-uml/command-line.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/command-line.xml 2009-12-15 00:37:43 UTC (rev 292145)
+++ pear/peardoc/trunk/en/package/php/php-uml/command-line.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -13,7 +13,7 @@
<refsection><info><title>Arguments</title></info>
- <para>Pass the files and/or the directories to parse as the main arguments:
+ <para>To specify the PHP files/directories to scan, pass them as main arguments:
<programlisting role="text">
<![CDATA[
$ phpuml /var/www/foo
@@ -33,7 +33,7 @@
<refsection><info><title>Options</title></info>
<example><info><title>Renaming the UML model name</title></info>
- <para>By default, the root package of a UML model is named <emphasis>default</emphasis>. To rename it, use the option <literal>-n</literal>:
+ <para>By default, the root package of a UML model is named <emphasis>default</emphasis>. To rename it, use the switch <literal>-n</literal>:
<programlisting role="text">
<![CDATA[
$ phpuml /var/www/foo -n MyProject
@@ -56,8 +56,24 @@
</example>
<example><info><title>Generating an API's documentation in HTML, or some PHP code</title></info>
- <para>In addition to <emphasis>xmi</emphasis>, 2 output formats are also available: <emphasis>html</emphasis>, and <emphasis>php</emphasis>.
- The HTML documentation produced is very similar to a Javadoc API, and offers many navigation possibilities.
+ <para>In addition to <emphasis>xmi</emphasis>, 3 output formats are also available: <emphasis>html</emphasis>, <emphasis>htmlnew</emphasis>, and <emphasis>php</emphasis>.
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ "htmlnew" is a full XHTML-compliant API documentation ("modern" look and feel). It has the particularity to reflect the procedural code, in addition to the object code. The global procedural functions and constants appear in the top package.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "html" is another HTML API documentation ("Javadoc" look and feel)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "php" is a PHP code generation (code skeletons)
+ </simpara>
+ </listitem>
+ </itemizedlist>
</para>
<para>Use the option <literal>-f</literal> to specify which format you want <literal>phpuml</literal> to generate.
<programlisting role="text">
@@ -65,7 +81,7 @@
$ phpuml /var/www/foo -f html -o /var/tmp/
]]>
</programlisting>
-This will scan <filename>/var/www/foo</filename>, and create a full HTML documentation in <filename>/var/tmp/</filename>.
+This will scan <filename>/var/www/foo</filename>, and create the API documentation in <filename>/var/tmp/</filename>.
</para>
<para>
@@ -113,13 +129,28 @@
</para>
</example>
- <para>Other options are available (like an option to exclude certain files or directories from parsing). You will discover them by asking for <emphasis role="bold">help</emphasis>, like this:
+ <example><info><title>Ignoring some files and folders</title></info>
+ <para>Use the switch <literal>-i</literal>:
<programlisting role="text">
<![CDATA[
+$ phpuml /var/www/foo -i tests *.php4
+ ]]>
+ </programlisting>
+This will parse all files, except the ones in the folder "tests", and the ones with an extension "php4".
+ </para>
+ </example>
+
+ <para>Other options are available. You will discover them by asking for <emphasis role="bold">help</emphasis>, like this:
+ <programlisting role="text">
+ <![CDATA[
$ phpuml -h
]]>
</programlisting>
</para>
+
+ <para>
+ Form more information about how PHP_UML interprets your PHP code, read <link linkend="package.php.php-uml.about-the-parser">this section</link>.
+ </para>
</refsection>
</refentry>
Deleted: pear/peardoc/trunk/en/package/php/php-uml/conversion-rules.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/conversion-rules.xml 2009-12-15 00:37:43 UTC (rev 292145)
+++ pear/peardoc/trunk/en/package/php/php-uml/conversion-rules.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.php.php-uml.conversion-rules">
- <refnamediv>
- <refname>Conversion rules</refname>
- <refpurpose>How do PHP elements map to UML concepts?</refpurpose>
- </refnamediv>
-
- <refsection><info><title>Logical view</title></info>
-
- <para>
- <itemizedlist>
- <listitem>
- <simpara>
- A PHP class (or interface) maps to an UML Class (or Interface).
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- A PHP function maps to an UML Operation.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- A PHP property, or class constant, maps to an UML Attribute.
- </simpara>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Packages do not exist in PHP, like they do in Java. There are two possible ways to mimic them:
- <itemizedlist>
- <listitem>
- <simpara>
- by using the PHP <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.php.net/manual/en/language.namespaces.php">namespace</link> instruction
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- by using the docblock <literal>@package</literal> in the comment of a class (or of a file)
- </simpara>
- </listitem>
- </itemizedlist>
- Note that the <literal>namespace</literal> and <literal>use</literal> instructions will be parsed only if you run PHP_UML with PHP from version 5.3.
- </para>
- </refsection>
-
- <refsection><info><title>Deployment view</title></info>
-
- <para>
- <itemizedlist>
- <listitem>
- <simpara>
- A PHP file maps to an UML Artifact.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- A physical folder maps to an UML Package.
- </simpara>
- </listitem>
- </itemizedlist>
- </para>
- </refsection>
- <refsection><info><title>Component view</title></info>
-
- <para>
- In UML 1.4:
- <itemizedlist>
- <listitem>
- <simpara>
- A class (or an interface) maps to an UML Component.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- A logical package maps to an UML Subpackage.
- </simpara>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- In UML 2.1:
- <itemizedlist>
- <listitem>
- <simpara>
- A class (or an interface) maps to an UML Component.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- A logical package maps to a nesting UML Component.
- </simpara>
- </listitem>
- </itemizedlist>
- </para>
- </refsection>
-</refentry>
Added: pear/peardoc/trunk/en/package/php/php-uml/extension.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/extension.xml (rev 0)
+++ pear/peardoc/trunk/en/package/php/php-uml/extension.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.php.php-uml.extension">
+ <refnamediv>
+ <refname>Extension</refname>
+ <refpurpose>How to extend PHP_UML?</refpurpose>
+ </refnamediv>
+
+ <refsection><info><title>Extension</title></info>
+ <para>
+ <classname>PHP_UML</classname> is designed with evolution in mind. By choosing XMI as the pivot format for representing the program's structure (namespaces, classes, functions...), PHP_UML can not only interface with design tools, it
+ can also produce other output formats, via XSL transformations (this is how the format "html" is generated).
+ </para>
+ <para>
+ If you only need to customize a bit the look and feel of the HTML doc, just modify the stylesheet (in <filename>/UML/Output/html/resources/style.css</filename>).
+ </para>
+ <para>But if you need deeper changes, you will have to create your own XSL transformation.
+ For that, start with a new folder under <filename>/UML/Output/</filename>, and put a <filename>main.xsl</filename> file inside (you can copy the one
+ in <filename>/Output/html/</filename>). Write all your XSLT stuff in <filename>main.xsl</filename>, or split it among multiple template files (that's
+ how PHP_UML does). Then run the method <literal>export("newFormat", ".")</literal>, by passing the name of your transformation as the first parameter.
+ </para>
+ <para>
+ Instead of transforming XMI code, another way to create additional output formats is to program a process that exploits the metamodel
+ that the parser has built.
+ This is how the exportation formats <literal>htmlnew</literal> and <literal>xmi</literal> work. If you want to write your own format, you
+ will have to program your own implementation
+ class of PHP_UML_Output_ExporterAPI, and put it into a new folder, under the folder Output (beside the folders HtmlNew and Xmi).
+ </para>
+ <para>
+ For a better understanding of the program's guts, see its class diagram, available in the docs folder (PHP_UML_simplified_class_diagram.png).
+ </para>
+ <para>
+ If you are interested by the PHP_UML project, and want to participate, do not hesitate to contact <link xmlns:xlink="http://www.baptisteautin.com/">me</link>.
+ </para>
+ </refsection>
+
+</refentry>
Modified: pear/peardoc/trunk/en/package/php/php-uml/intro.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-uml/intro.xml 2009-12-15 00:37:43 UTC (rev 292145)
+++ pear/peardoc/trunk/en/package/php/php-uml/intro.xml 2009-12-15 01:31:34 UTC (rev 292146)
@@ -7,7 +7,7 @@
<refsection><info><title>Description</title></info>
<para>
- <classname>PHP_UML</classname> is a reverse-engineering tool, and an API's documentation tool.
+ <classname>PHP_UML</classname> is a reverse-engineering tool, and an API documentation tool.
</para>
<para>
It can parse PHP files, and immediately generate:
@@ -21,7 +21,7 @@
</listitem>
<listitem>
<simpara>
- A full HTML API documentation, very similar to <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://java.sun.com/j2se/javadoc/reference/docs/">Javadoc</link>
+ A full HTML API documentation. Two themes are available (an oldie, similar to <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://java.sun.com/j2se/javadoc/reference/docs/">Javadoc</link>, and a modern looking one)
</simpara>
</listitem>
<listitem>
@@ -31,14 +31,14 @@
</listitem>
</itemizedlist>
</para>
- <para>
- <classname>XMI</classname> is an <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.omg.org/">OMG</link> standard for exchanging metadata information via XML, and is commonly used as an interchange format for UML models. Many UML softwares support importing and exporting of XMI files.
- </para>
+ <para>From its version 1.5, PHP_UML can also parse procedural code. The export format called "htmlnew" benefits from this new capability, and turns
+ PHP_UML into a kind of competitor of <link linkend="package.php.phpdocumentor">PhpDocumentor</link> (although it does not offer all of its features).
+ See <link xmlns:xlink="http://www.baptisteautin.com/wp-content/uploads/PHP_UML/API-htmlnew/">here</link> an example of an API documentation as generated by PHP_UML.</para>
</refsection>
<refsection><info><title>Features</title></info>
<para>
- Like <link linkend="package.php.phpdocumentor">PhpDocumentor</link>, <classname>PHP_UML</classname> can parse the following PHP elements: <emphasis role="bold">namespaces</emphasis>, classes, interfaces, properties, and functions. It can also retrieve information from the inline comments, via the docblocks: <literal>@package</literal>, <literal>@var</literal>, <literal>@param</literal>
+ <classname>PHP_UML</classname> is able to parse the following PHP elements: <emphasis role="bold">namespaces</emphasis>, classes, interfaces, properties, and functions. It can also retrieve information from the inline comments, via the annotations: <literal>@package</literal>, <literal>@var</literal>, <literal>@param</literal>
<itemizedlist>
<listitem>
<simpara>
@@ -55,18 +55,11 @@
<para>
So the more documented your PHP code is, the more precise your XMI file, or your API documentation, will be.
</para>
- <para>
- At the current time, the UML/XMI standards exist in two distinct families of versions, 1.x and 2.x. PHP_UML can generate XMI in version <emphasis role="bold">1.4</emphasis>, as well as in version <emphasis role="bold">2.1</emphasis>.
- Be warned, though, that some UML tools might not interpret accurately the data contained in your XMI file. For example, the link between a UML artifact (a source file) and the classes defined inside that artifact is only available from version 2 of UML.
- </para>
- <para>
- PHP_UML can also convert existing UML/XMI data from version 1.4 to version 2 (simple conversion).
- </para>
</refsection>
<refsection><info><title>Usage</title></info>
- <para>You can use PHP_UML either from <link linkend="package.php.php-uml.command-line">command line</link>, or by writing a piece of code that will rely on PHP_UML.</para>
+ <para>You can use PHP_UML either from <link linkend="package.php.php-uml.command-line">command line</link> (the simplest solution), or by writing a piece of code that relies on PHP_UML.</para>
<example><info><title>Parsing a single file <filename>test.php</filename>, and generating its XMI file:</title></info>
<programlisting role="php">
<![CDATA[
@@ -74,43 +67,23 @@
require_once 'PHP/UML.php';
$uml = new PHP_UML();
-$uml->parseFile('test.php');
-$uml->generateXMI(1); // UML version number (1 or 2)
-$uml->saveXMI('test.xmi');
+$uml->setInput('tests'); // this defines which files/folders to parse (here, the folder "tests")
+$uml->parse('myApp'); // this starts the parser, and gives the name "myApp" to the generated metamodel
+$uml->export('xmi', 'myApp.xmi'); // this serializes the metamodel in XMI code, and saves it to a file "myApp.xmi"
?>
]]>
</programlisting>
</example>
</refsection>
- <refsection><info><title>Compatibility of XMI</title></info>
- <para>Your UML/XMI code might be interpreted differently by the modeling tool you are going to use along with PHP_UML.
-This is particularly true for the version 2 of UML/XMI.
-For instance, the Eclipse plug-ins (EMF, Papyrus) only accept a particular flavour of XMI, called <emphasis>ecore</emphasis>, which is only partly compatible with the one you will get with <literal>PHP_UML</literal>.
- </para>
- </refsection>
-
- <refsection><info><title>Extension</title></info>
+ <refsection><info><title>About XMI</title></info>
<para>
- <classname>PHP_UML</classname> is designed with evolution in mind. By choosing XMI as the pivot format for representing the program's structure (namespaces, classes, functions...), PHP_UML can not only interface with many design tools.
- It can also produce other output formats, via XSL transformations (this is how the HTML documentation is generated).
+ At the current time, the UML/XMI standards exist in two distinct families of versions, 1.x and 2.x. PHP_UML can generate XMI in version <emphasis role="bold">1.4</emphasis>, as well as in version <emphasis role="bold">2.1</emphasis>.
+ Be warned, though, that some UML tools might not interpret accurately the data contained in your XMI file. For example, the link between a UML artifact (a source file) and the classes defined inside that artifact is only available from version 2 of UML.
</para>
<para>
- If you only need to customize a bit the look and feel of the HTML doc, just modify the stylesheet (in <filename>/UML/Output/html/resources/style.css</filename>).
+ PHP_UML can also convert existing UML/XMI data from version 1.4 to version 2. An inline converter (using PHP_UML behind the scene) is available <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.baptisteautin.com/projets-personnels/php_uml/convertisseur-de-fichier-xmi/lang/en/">here</link>.
</para>
- <para>But if you need deeper changes, you will have to create your own XSL transformation.
- For that, start with a new folder under <filename>/UML/Output/</filename>, and put a <filename>main.xsl</filename> file inside (you can copy the one in <filename>/Output/html/</filename>). Write all your XSLT stuff in <filename>main.xsl</filename>, or split it among multiple template files (that's how PHP_UML does). Then run the method <literal>PHP_UML->export("newFormat")</literal>, by passing the name of your transformation as the first parameter.
- </para>
- <para>
- Instead of transforming XMI code, another way to create additional output formats would be to write a PHP class that would directly exploit the metamodel that the parser has built, exactly like the package <literal>XMI</literal>'s classes do.
- That dedicated class should implement <literal>PHP_UML_XMI_Builder</literal>.
- </para>
- <para>
- For a better understanding of the program's guts, see its class diagram, available in the docs folder (PHP_UML_class_diagram.png).
- </para>
- <para>
- If you are interested by the PHP_UML project, and want to participate, do not hesitate to contact me.
- </para>
</refsection>
</refentry>