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

Class: ProceduralPages

Source Location: /phpDocumentor/ProceduralPages.inc

Class ProceduralPages

Class Overview

Intermediate procedural page parsing structure.

This structure parses defines, functions, and global variables by file, and then iterates over the elements to document conflicts.

Located in /phpDocumentor/ProceduralPages.inc [line 49]



		
				Author(s):
		
		
		
Information Tags:
Version:  $Id: ProceduralPages.inc,v 1.4 2006/10/23 03:32:56 cellog Exp $
Since:  1.1

Properties

Methods

[ Top ]
Property Summary
string   $curfile   file being parsed, used in every add function to match up elements with the file that contains them
array   $defineconflicts   Namespace conflicts within all documented packages of functions
array   $definesbyfile   array of parsed defines organized by the full path of the file that contains the define.
array   $definesbynamefile   array of file names organized by defines that are in the file.
array   $functionconflicts   Namespace conflicts within all documented packages of functions
array   $functionsbyfile   array of parsed functions organized by the full path of the file that contains the function.
array   $functionsbynamefile   array of file names organized by functions that are in the file.
array   $globalconflicts   Namespace conflicts within all documented packages of functions
array   $globalsbyfile   array of parsed global variables organized by the full path of the file that contains the global variable definition.
array   $globalsbynamefile   array of file names organized by global variables that are in the file.
array   $ignorepages   array of all procedural pages ordered by name that have been ignored via -po or @access private or @ignore
array   $includesbyfile   array of parsed includes organized by the full path of the file that contains the include.
array   $pageclasspackages   array of packages assigned to classes in a file, ordered by fullpath
array   $pageconflicts   Namespace conflicts within all documented pages
array   $pagepackages   array of packages ordered by full path
array   $pages   array of all procedural pages ordered by name
array   $pathpages   array of all procedural page names ordered by full path to the file

[ Top ]
Method Summary
void   addClassPackageToFile()   adds a package from a class to the current file
void   addDefine()   sets up the $definesbyfile array using $curfile
void   addFunction()   sets up the $functionsbyfile array using $curfile
void   addGlobal()   sets up the $globalsbyfile array using $curfile
void   addInclude()   sets up the $includesbyfile array using $curfile
void   addPage()   sets up the $pages array
void   addPagePackage()   Changes the package of the page represented by $path
void   getPathInfo()  
array|string   getRealPath()  
void   ignorePage()   moves a page from the $pages array to the $ignorepages array
false|parserPage   pathMatchesParsedFile()  
void   replaceElement()   Used to align an element with the package of its parent page prior to Conversion.
void   setName()   Change a page's name from its file to alias $name
void   setParseBase()  
void   setupPagePackages()   if there is one class package in a file, the parent path inherits the package if its package is default.
void   setupPages()   Adjusts packages of all pages and removes name conflicts within a package

[ Top ]
Properties
string   $curfile [line 56]

file being parsed, used in every add function to match up elements with the file that contains them

API Tags:
See:  addClass(), addMethod(), addVar(), nextFile()


[ Top ]
array   $defineconflicts = array() [line 167]

Namespace conflicts within all documented packages of functions

Format: array(functionname => array(full path, full path,...))


[ Top ]
array   $definesbyfile = array() [line 98]

array of parsed defines organized by the full path of the file that contains the define.

Format: array(full path => array(definename => parserDefine))


[ Top ]
array   $definesbynamefile = array() [line 123]

array of file names organized by defines that are in the file.

This structure is designed to handle name conflicts. Two files can contain defines with the same name, and this array will record both filenames to help control namespace errors Format: array(definename => array(full path of file containing definename, full path of file 2 containing definename...)


[ Top ]
array   $functionconflicts = array() [line 153]

Namespace conflicts within all documented packages of functions

Format: array(functionname => array(full path, full path,...))


[ Top ]
array   $functionsbyfile = array() [line 91]

array of parsed functions organized by the full path of the file that contains the function.

Format: array(full path => array(functionname => parserFunction))


[ Top ]
array   $functionsbynamefile = array() [line 114]

array of file names organized by functions that are in the file.

This structure is designed to handle name conflicts. Two files can contain functions with the same name, and this array will record both filenames to help control namespace errors Format: array(functionname => array(full path of file containing functionname, full path of file 2 containing functionname...)


[ Top ]
array   $globalconflicts = array() [line 174]

Namespace conflicts within all documented packages of functions

Format: array(functionname => array(full path, full path,...))


[ Top ]
array   $globalsbyfile = array() [line 105]

array of parsed global variables organized by the full path of the file that contains the global variable definition.

Format: array(full path => array(globalname => parserGlobal))


[ Top ]
array   $globalsbynamefile = array() [line 132]

array of file names organized by global variables that are in the file.

This structure is designed to handle name conflicts. Two files can contain global variables with the same name, and this array will record both filenames to help control namespace errors Format: array(global variablename => array(full path of file containing global variablename, full path of file 2 containing global variablename...)


[ Top ]
array   $ignorepages = array() [line 70]

array of all procedural pages ordered by name that have been ignored via -po or @access private or @ignore

Format: array(name => array(fullpath => parserPage,fullpath => parserPage2 [if there are name conflicts],...))


[ Top ]
array   $includesbyfile = array() [line 84]

array of parsed includes organized by the full path of the file that contains the include.

Format: array(full path => array(includename => parserInclude))


[ Top ]
array   $pageclasspackages = array() [line 146]

array of packages assigned to classes in a file, ordered by fullpath

Format: array(fullpath => array(packagename => array(subpackagename => 1,subpackagename => 1,..),packagename2 =>...)


[ Top ]
array   $pageconflicts = array() [line 160]

Namespace conflicts within all documented pages

Format: array(pagename => array(fullpath, fullpath,...))


[ Top ]
array   $pagepackages = array() [line 139]

array of packages ordered by full path

Format: array(fullpath => array(packagename,subpackagename))


[ Top ]
array   $pages = array() [line 63]

array of all procedural pages ordered by name

Format: array(name => array(fullpath => parserPage,fullpath => parserPage2 [if there are name conflicts],...))


[ Top ]
array   $pathpages = array() [line 77]

array of all procedural page names ordered by full path to the file

Format: array(fullpath => name)


[ Top ]
Methods
addClassPackageToFile  [line 411]

  void addClassPackageToFile( string $file, string $package, $subpackage  )

adds a package from a class to the current file

Parameters:
string   $file:  full path to the file that contains the class
string   $package:  package name
   $subpackage: 


[ Top ]
addDefine  [line 344]

  void addDefine( parserDefine &$element  )

sets up the $definesbyfile array using $curfile

Parameters:
parserDefine   &$element: 


[ Top ]
addFunction  [line 302]

  void addFunction( parserFunction &$element  )

sets up the $functionsbyfile array using $curfile

Parameters:
parserFunction   &$element: 


[ Top ]
addGlobal  [line 323]

  void addGlobal( parserGlobal &$element  )

sets up the $globalsbyfile array using $curfile

Parameters:
parserGlobal   &$element: 


[ Top ]
addInclude  [line 293]

  void addInclude( parserInclude &$element  )

sets up the $includesbyfile array using $curfile

Parameters:
parserInclude   &$element: 


[ Top ]
addPage  [line 186]

  void addPage( parserPage &$element  )

sets up the $pages array

Parameters:
parserPage   &$element: 


[ Top ]
addPagePackage  [line 246]

  void addPagePackage( string $path, string $package, string $subpackage  )

Changes the package of the page represented by $path

changes package in both the $pages array and the pagepackages array

Parameters:
string   $path:  full path
string   $package: 
string   $subpackage: 


[ Top ]
getPathInfo  [line 204]

  void getPathInfo( $path, &$c  )

Parameters:
   $path: 
   &$c: 


[ Top ]
getRealPath  [line 764]

  array|string getRealPath( string $path, string $file, string 2  )

Parameters:
string   2:  full path to base directory of parsing, used for .
string   $path:  include() statement path to check
string   $file:  full path of file the statement is in

API Tags:
Return:  returns an array of possible file locations or a string if there is an exact match


[ Top ]
ignorePage  [line 198]

  void ignorePage( parserPage &$element  )

moves a page from the $pages array to the $ignorepages array

Parameters:
parserPage   &$element: 


[ Top ]
pathMatchesParsedFile  [line 723]

  false|parserPage pathMatchesParsedFile( $path, $infile  )

Parameters:
   $path: 
   $infile: 

API Tags:
Return:  returns matched parserPage if found


[ Top ]
replaceElement  [line 365]

  void replaceElement( parserElement &$element  )

Used to align an element with the package of its parent page prior to Conversion.

Parameters:
parserElement   &$element: 


[ Top ]
setName  [line 230]

  void setName( string $name  )

Change a page's name from its file to alias $name

This function is used to handle a @name tag in a page-level DocBlock

Parameters:
string   $name: 


[ Top ]
setParseBase  [line 715]

  void setParseBase( $pbase  )

Parameters:
   $pbase: 


[ Top ]
setupPagePackages  [line 427]

  void setupPagePackages( )

if there is one class package in a file, the parent path inherits the package if its package is default.

helps with -po to avoid dumb bugs



[ Top ]
setupPages  [line 663]

  void setupPages( phpDocumentor_IntermediateParser &$render  )

Adjusts packages of all pages and removes name conflicts within a package

Automatic linking requires that each linkable name have exactly one element associated with it. In other words, there cannot be two functions named foo() in the same package. This also adheres to php rules with one exception:

  1.  if ($test == 3)
  2.  {
  3.     define('whatever','this thing');
  4.  else
  5.  {
  6.     define('whatever','this other thing');
  7.  }

phpDocumentor is not aware of conditional control structures because it would slow things down considerably. So, what phpDocumentor does is automatically ignore the second define and raise a warning. The warning can be eliminated with an @ignore tag on the second element like so:

  1.  if ($test == 3)
  2.  {
  3.     define('whatever','this thing');
  4.  else
  5.  {
  6.     /** @ignore */
  7.     define('whatever','this other thing');
  8.  }

if there are two files that contain the same procedural elements in the same package (for example, a common configuration file common.php), they will also be ignored as if they were in the same file. The reasoning behind this is simple. A package is an indivisible set of files and classes that a user will include in their code. Name conflicts must be avoided to allow successful execution.

This function also plays the all-important role of calling phpDocumentor_IntermediateParser::addElementToPage() in order to add processed elements to their pages for Conversion.

Parameters:
phpDocumentor_IntermediateParser   &$render: 


[ Top ]

Documentation generated on Tue, 24 Oct 2006 09:25:59 -0500 by phpDocumentor 1.3.1