PHP_UML
[ class tree: PHP_UML ] [ index: PHP_UML ] [ all elements ]

Class: PHP_UML

Source Location: /PHP_UML-0.5.1/UML.php

Class Overview


The main class to use, through its methods:


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 55]
The main class to use, through its methods:

  • setFiles(), setDirectories() and parse()
  • parseFile() and parseDirectory()
  • generateXMI()
  • saveXMI()
For example:
  1.  $t = new PHP_UML();
  2.  $t->parseDirectory('PHP_UML/');
  3.  $t->generateXMI(2);
  4.  $t->saveXMI('PHP_UML2.xmi');

If you want to produce XMI without using the PHP parser, please refer to the file /examples/test_with_api.php; it will show how you can build a model by yourself, with the PHP_UML_Metamodel package.



[ Top ]


Class Variables

$componentView =  false

[line 79]

If true, a component view is created.

file system. Each file produces an component

  • Access: public

Type:   boolean


[ Top ]

$deploymentView =  true

[line 72]

If true, a UML deployment view is created.

Each file produces an artifact.

  • Access: public

Type:   boolean


[ Top ]

$docblocks =  true

[line 86]

If true, docblocks are interpreted

(especially @package and @param, which can have a major influence)

  • Access: public

Type:   boolean


[ Top ]

$dollar =  true

[line 92]

If true, the PHP variable prefix $ is kept
  • Access: public

Type:   boolean


[ Top ]

$logicalView =  true

[line 65]

If true, a UML logical view is created.
  • Access: public

Type:   boolean


[ Top ]

$model =

[line 99]

A reference to a PHP_UML_Metamodel_Superstructure object.
  • Access: public

Type:   PHP_UML::Metamodel::PHP_UML_Metamodel_Superstructure


[ Top ]



Method Detail

__construct (Constructor)   [line 151]

PHP_UML __construct( )

Constructor
  • Access: public

[ Top ]

autoload   [line 557]

void autoload( string $class)

Autoloader

Parameters:

string   $class   —  Class name

[ Top ]

export   [line 476]

void export( [string $format = 'xmi'], [string $outputDir = '.'])

Generates the output data

The default format is XMI. But PHP_UML comes with two additional formats:

  • HTML (an API documentation, very similar to Javadoc)
  • PHP code generation (a simple PHP code skeleton)
The templates are stored under /Output/<format_name>/ You are free to develop your owns. Except for XMI (which is internally generated), the generation is done through a complex XSLT transformation, applied to XMI data. PHP_UML will look for a "main.xsl" file, in the folder of the desired format.

Since the generation rely on XMI data, an XMI generation will be performed in all cases.

  • Access: public

Parameters:

string   $format   —  Desired format ("xmi", "html", "php")
string   $outputDir   —  Output directory

[ Top ]

generateXMI   [line 397]

void generateXMI( [float $version = 2.1], [string $encoding = 'iso-8859-1'])

Runs the XMI generator on the PHP model stored in $this->model.

After their PHP parsing, parseDirectory() or parseFile() will have set $this->model for you.

If you need to use the XMI generator without any previous PHP parsing, simply set $this->model with a proper PHP_UML_Metamodel_Superstructure object

  • Access: public

Parameters:

float   $version   —  XMI Version For XMI 1.x, any value below 2. For XMI 2.x, any value above or equal to 2.
string   $encoding   —  XML Encoding (iso-8859-1 or utf-8)

[ Top ]

getXMI   [line 498]

string getXMI( )

Public accessor to the XMI code
  • Return: The XMI code
  • Access: public

[ Top ]

parse   [line 332]

void parse( [string $modelName = 'default'])

Parse directories and files, depending on what the "_directories" and "_files" properties have been set to (with setDirectory() and setFile())
  • Access: public

Parameters:

string   $modelName   —  Model name (likely, the name of your application)

[ Top ]

parseDirectory   [line 320]

void parseDirectory( mixed $directories, [string $model = 'default'])

Parses a PHP folder, and builds a PHP_UML_Metamodel_Superstructure object corresponding to what has been parsed.

To get the XMI serialization of that object, run generateXMI()

  • Access: public

Parameters:

mixed   $directories   —  Directory path(es). Can be a single path, or an array of pathes.
string   $model   —  Model name

[ Top ]

parseFile   [line 164]

void parseFile( mixed $files, [string $model = 'default'])

Parses a PHP file, and builds a PHP_UML_Metamodel_Superstructure object corresponding to what has been found in the file.

To get the XMI serialization of that object, run generateXMI()

  • Access: public

Parameters:

mixed   $files   —  File(s) to parse. Can be a single file, or an array of files.
string   $model   —  Model name

[ Top ]

readXMIFile   [line 175]

void readXMIFile( string $filepath)

Read the content of an existing XMI file
  • Access: public

Parameters:

string   $filepath   —  Filename

[ Top ]

saveXMI   [line 444]

void saveXMI( string $outputFile)

Saves the previously generated XMI to a file You must run that method to get your XMI, or you can access the XMI property
  • Access: public

Parameters:

string   $outputFile   —  Filename

[ Top ]

setIgnorePatterns   [line 281]

void setIgnorePatterns( mixed $patterns)

Set a list of files / directories to ignore during parsing Usage: $phpuml->setIgnorePatterns(array('examples', '.svn')); Or: $phpuml->setIgnorePatterns('examples .svn');
  • Access: public

Parameters:

mixed   $patterns   —  List of patterns (string or array)

[ Top ]

setInput   [line 189]

void setInput( mixed $pathes)

Set the input elements (files and/or directories) to parse
  • Access: public

Parameters:

mixed   $pathes   —  Array, or string of comma-separated-values

[ Top ]

setMatchPatterns   [line 264]

void setMatchPatterns( mixed $patterns)

Setter for the filename patterns.

Usage: $phpuml->setFilePatterns(array('*.php', '*.php5')); Or: $phpuml->setFilePatterns('*.php, *.php5');

  • Access: public

Parameters:

mixed   $patterns   —  List of patterns (string or array)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:28:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.