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

Class: ProceduralPages

Source Location: /phpDocumentor/ProceduralPages.inc

Class Overview


Intermediate procedural page parsing structure.


Author(s):

Version:

  • Release: @VER@

Copyright:

  • 2002-2008 Gregory Beaver

Variables

Methods



Class Details

[line 58]
Intermediate procedural page parsing structure.

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




Tags:

author:  Greg Beaver <[email protected]>
version:  Release: @VER@
copyright:  2002-2008 Gregory Beaver
link:  http://pear.php.net/PhpDocumentor
link:  http://www.phpdoc.org
todo:  CS cleanup - change package to PhpDocumentor
since:  1.1
license:  LGPL


[ Top ]


Class Variables

$curfile =

[line 67]

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



Tags:

see:  addClass(), addMethod(), addVar(), nextFile()

Type:   string


[ Top ]

$defineconflicts = array()

[line 314]

Namespace conflicts within all documented packages of functions

Format:

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



Type:   array


[ Top ]

$definesbyfile = array()

[line 157]

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

Format:

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



Type:   array


[ Top ]

$definesbynamefile = array()

[line 211]

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,
             ...
         )
     )



Type:   array


[ Top ]

$functionconflicts = array()

[line 282]

Namespace conflicts within all documented packages of functions

Format:

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



Type:   array


[ Top ]

$functionsbyfile = array()

[line 142]

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

Format:

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



Type:   array


[ Top ]

$functionsbynamefile = array()

[line 192]

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,
             ...
         )
     )



Type:   array


[ Top ]

$globalconflicts = array()

[line 330]

Namespace conflicts within all documented packages of functions

Format:

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



Type:   array


[ Top ]

$globalsbyfile = array()

[line 172]

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
         )
     )



Type:   array


[ Top ]

$globalsbynamefile = array()

[line 231]

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,
             ...
         )
     )



Type:   array


[ Top ]

$ignorepages = array()

[line 100]

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],
             ...
         )
     )



Type:   array


[ Top ]

$includesbyfile = array()

[line 127]

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

Format:

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



Type:   array


[ Top ]

$pageclasspackages = array()

[line 266]

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

Format:

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



Type:   array


[ Top ]

$pageconflicts = array()

[line 298]

Namespace conflicts within all documented pages

Format:

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



Type:   array


[ Top ]

$pagepackages = array()

[line 246]

array of packages ordered by full path

Format:

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



Type:   array


[ Top ]

$pages = array()

[line 83]

array of all procedural pages ordered by name

Format:

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



Type:   array


[ Top ]

$pathpages = array()

[line 112]

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

Format:

     array(
         fullpath => name
     )



Type:   array


[ Top ]



Class Methods


method addClassPackageToFile [line 613]

void addClassPackageToFile( string $file, string $package, string $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
string   $subpackage   subpackage name

[ Top ]

method addDefine [line 552]

void addDefine( parserDefine &$element)

sets up the $definesbyfile array using $curfile



Parameters:

parserDefine   &$element   the "define" element

[ Top ]

method addFunction [line 508]

void addFunction( parserFunction &$element)

sets up the $functionsbyfile array using $curfile



Parameters:

parserFunction   &$element   the "function" object

[ Top ]

method addGlobal [line 530]

void addGlobal( parserGlobal &$element)

sets up the $globalsbyfile array using $curfile



Parameters:

parserGlobal   &$element   the "global" element

[ Top ]

method addInclude [line 496]

void addInclude( parserInclude &$element)

sets up the $includesbyfile array using $curfile



Parameters:

parserInclude   &$element   the "include" element object

[ Top ]

method addPage [line 349]

void addPage( parserPage &$element)

sets up the $pages array



Parameters:

parserPage   &$element   the parser page element

[ Top ]

method addPagePackage [line 450]

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   the package name
string   $subpackage   the subpackage name

[ Top ]

method getPathInfo [line 385]

array|bool getPathInfo( string $path, mixed &$c)

gathers path-related info about a given element



Tags:

return:  an array of path info, or FALSE
todo:  figure out what &$c is and update the param tag


Parameters:

string   $path   path to the element
mixed   &$c   ???

[ Top ]

method getRealPath [line 1033]

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

Ensures the path to the file is an absolute path



Tags:

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


Parameters:

string   $path   path to the file
string   $file   the file name

[ Top ]

method ignorePage [line 368]

void ignorePage( parserPage &$element)

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



Parameters:

parserPage   &$element   the parser page element

[ Top ]

method pathMatchesParsedFile [line 983]

parserPage|bool pathMatchesParsedFile( string $path, string $infile)

checks to see if the parsed file matches the given path



Tags:

return:  matched parserPage if found, or FALSE if not found


Parameters:

string   $path   the path to look for
string   $infile   the file to check

[ Top ]

method replaceElement [line 575]

void replaceElement( parserElement &$element)

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



Parameters:

parserElement   &$element   the element to align

[ Top ]

method setName [line 421]

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   the alias

[ Top ]

method setParseBase [line 969]

void setParseBase( mixed $pbase)

sets the parser base



Parameters:

mixed   $pbase   the parser base

[ Top ]

method setupPagePackages [line 628]

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 ]

method setupPages [line 911]

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.     define('whatever''this thing');
  3.  else {
  4.     define('whatever''this other thing');
  5.  }

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.     define('whatever''this thing');
  3.  else {
  4.     /**
  5.      * @ignore
  6.      */
  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   the parser

[ Top ]


Documentation generated on Tue, 06 Dec 2011 07:14:59 -0600 by phpDocumentor 1.4.4