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

Class: PHP_UML

Source Location: /PHP_UML-0.4.4/UML.php

Class Overview

PHP_UML_Scanner
   |
   --PHP_UML

The main class to use, through its methods :


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: PHP_UML_Scanner

PHP_UML_Scanner::traverseDirectory()
Traverse a directory to parse its files

Class Details

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

  • parseFile()
  • parseDirectory()
  • generateXMI()
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, which shows how you can build a PHP_UML_Metamodel_Superstructure object by yourself, through PHP_UML_Metamodel_Sequence objects.



[ Top ]


Class Variables

$acceptedExtensions = array('php')

[line 123]

Extensions of files to scan (as an array of values)
  • Access: public

Type:   Array


[ Top ]

$componentView =  true

[line 137]

If true, a component view is created at the root level, enclosing the whole scanned

file system. Each file produces an component

  • Access: public

Type:   bool


[ Top ]

$deploymentView =  true

[line 130]

If true, a deployment view is created at the root level, enclosing the whole scanned

file system. Each file produces an artifact

  • Access: public

Type:   bool


[ Top ]

$docblocks =  true

[line 143]

If true, docblocks are read (classes, functions, properties, and files docblocks)
  • Access: public

Type:   bool


[ Top ]

$dollar =  true

[line 149]

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

Type:   bool


[ Top ]

$model =

[line 157]

A reference to a PHP_UML_Metamodel_Superstructure object.

Normally, either parseFile() or parserDirectory() will set it, once their job is done. But you can set it yourself with a pre-defined instance of PHP_UML_Metamodel_Superstructure.

  • Access: public



[ Top ]



Method Detail

atFile   [line 410]

void atFile( int $level, string $filePath)

Executed for each file discovered in a folder You should not bother about that function
  • Access: protected

Parameters:

int   $level   —  Directories recursion level
string   $filePath   —  Current file path

[ Top ]

atFolderIn   [line 434]

void atFolderIn( int $level, string $dir)

Executed when entering a new folder
  • Access: protected

Parameters:

int   $level   —  Level of recursion
string   $dir   —  Name of folder

[ Top ]

atFolderOut   [line 445]

void atFolderOut( int $level, string $dir)

Executed when leaving a folder
  • Access: protected

Parameters:

int   $level   —  Level of recursion
string   $dir   —  Name of folder

[ Top ]

__construct (Constructor)   [line 212]

PHP_UML __construct( )

Constructor
  • Access: public

[ Top ]

generateXMI   [line 309]

void generateXMI( [float $version = 2.1], [string $xmlEncoding = '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   $xmlEncoding   —  XML Encoding

[ Top ]

parseDirectory   [line 265]

void parseDirectory( mixed $path, [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   $path   —  Path(s) of the directories. Can be a single path, or an array of pathes.
string   $model   —  Name of the model placed at root (enclosing pkg)

[ Top ]

parseFile   [line 226]

void parseFile( mixed $filename, [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   $filename   —  File(s) to parse. Can be a single file, or an array of files.
string   $model   —  Name of the model placed at root (enclosing pkg). It is the "PHP global" namespace

[ Top ]

saveXMI   [line 344]

void saveXMI( string $output_file)

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   $output_file   —  Filename

[ Top ]

__get   [line 385]

string __get( string $name)

Public accessor to the XMI code
  • Return: The XMI code, or a PHP_UML_Parser_Result object
  • Access: public

Parameters:

string   $name   —  Possible value(s) : "XMI"

[ Top ]


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