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

Class: Converter

Source Location: /PhpDocumentor-1.2.0beta2/phpDocumentor/Converter.inc

Class Overview


Base class for all output converters.


Author(s):

Version:

  • $Id: Converter.inc,v 1.138 2003/01/18 07:25:19 CelloG Exp $

Variables

Methods


Child classes:

CHMdefaultConverter
CHM output converter.
HTMLdefaultConverter
HTML output converter.
HTMLframesConverter
HTML output converter.
HTMLSmartyConverter
HTML output converter.
PDFdefaultConverter
PDF output converter.
XMLDocBookConverter
XML DocBook converter.

Inherited Variables

Inherited Methods


Class Details

[line 33]
Base class for all output converters.

A Converter takes output from the phpDocumentor_IntermediateParser and converts it to output. With version 1.2, phpDocumentor includes a variety of output converters:

The converter takes output directly from phpDocumentor_IntermediateParser and using walk() or walk_everything (depending on the value of $sort_absolutely_everything) it "walks" over an array of phpDocumentor elements.



[ Top ]


Class Variables

$all_packages =

[line 217]


Type:   array


[ Top ]

$class =  false

[line 54]

set to a classname if currently parsing a class, false if not

Type:   string|false


[ Top ]

$classes =

[line 205]


Type:   Classes


[ Top ]

$class_contents = array()

[line 164]

alphabetical index of all methods and vars in a class by package/subpackage

The class itself has a link under ###main


Type:   array


[ Top ]

$class_elements = array()

[line 116]

alphabetized index of classes by package

Type:   array


[ Top ]

$curfile =

[line 200]

name of the current file being converted

Type:   mixed


[ Top ]

$define_elements = array()

[line 110]

alphabetized index of defines by package

Type:   array


[ Top ]

$elements = array()

[line 98]

alphabetical index of all elements

Type:   array


[ Top ]

$function_elements = array()

[line 128]

alphabetized index of functions by package

Type:   array


[ Top ]

$global_elements = array()

[line 122]

alphabetized index of global variables by package

Type:   array


[ Top ]

$leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => true, 'globals' => true)

[line 229]

Controls which of the one-element-only indexes are generated.

Generation of these indexes for large packages is time-consuming. This is an optimization feature. An example of how to use this is in HTMLframesConverter::$leftindex, and in HTMLframesConverter::formatLeftIndex(). These indexes are intended for use as navigational aids through documentation, but can be used for anything by converters.


Type:   array


[ Top ]

$outputformat =  'Generic'

[line 39]

output format of this converter

Type:   string


[ Top ]

$package =  'default'

[line 44]

package name

Type:   string


[ Top ]

$package_elements = array()

[line 92]

alphabetical index of all elements sorted by package, subpackage, page, and class. Used by

Type:   array


[ Top ]

$package_output =

[line 86]

set to value of -po commandline

Type:   mixed


[ Top ]

$package_parents =

[line 211]


Type:   array


[ Top ]

$page_contents = array()

[line 143]

alphabetical index of all elements on a page by package/subpackage

The page itself has a link under ###main


Type:   array


[ Top ]

$page_elements = array()

[line 104]

alphabetized index of procedural pages by package

Type:   array


[ Top ]

$parseprivate =

[line 171]

controls processing of elements marked private with @access private

defaults to false. Set with command-line --parseprivate or -pp


Type:   bool


[ Top ]

$pkg_elements = array()

[line 134]

alphabetical index of all elements

Type:   array


[ Top ]

$quietmode =

[line 178]

controls display of progress information while parsing.

defaults to false. Set to true for cron jobs or other situations where no visual output is necessary


Type:   bool


[ Top ]

$sort_absolutely_everything =  false

[line 156]

This is used if the content must be passed in the order it should be read, i.e. by package, procedural then classes

This fixes bug 637921, and is used by PDFdefaultConverter


Type:   mixed


[ Top ]

$sort_page_contents_by_type =  false

[line 150]

This determines whether the $page_contents array should be sorted by element type as well as alphabetically by name

Type:   boolean


[ Top ]

$subpackage =  ''

[line 49]

subpackage name

Type:   string


[ Top ]

$targetDir =  ''

[line 183]

directory that output is sent to. -t command-line sets this.

Type:   mixed


[ Top ]

$templateDir =  ''

[line 189]

Directory that the template is in, relative to phpDocumentor root directory

Type:   string


[ Top ]

$templateName =  ''

[line 195]

Name of the template

Type:   string


[ Top ]

$template_options =

[line 250]

Options for each template, parsed from the options.ini file in the template base directory

Type:   array


[ Top ]

$title =  'Generated Documentation'

[line 237]


Type:   string


[ Top ]



Method Detail

Converter (Constructor)   [line 279]

Converter Converter( array &$allp, array &$packp, Classes &$classes, ProceduralPages &$procpages, array $po, boolean $pp, boolean $qm, string $targetDir, string $template, string $title)

Initialize Converter data structures

Parameters:

array   &$allp     $all_packages value
array   &$packp     $package_parents value
Classes   &$classes     $classes value
ProceduralPages   &$procpages     $proceduralpages value
array   $po     $package_output value
boolean   $pp     $parseprivate value
boolean   $qm     $quietmode value
string   $targetDir     $targetDir value
string   $template     $templateDir value
string   $title     (@link $title} value

[ Top ]

AttrToString   [line 712]

string AttrToString( string $tag, attribute $attr, [boolean $unmodified = false])

Convert the attribute of a Tutorial docbook tag's attribute list

to a string based on the template options.ini


Parameters:

string   $tag     tag name
attribute   $attr     array
boolean   $unmodified     if true, returns attrname="value"...

[ Top ]

Bolden   [line 496]

string Bolden( string $para)

Used to convert the contents of <b> in a docblock

Parameters:

string   $para     

[ Top ]

Br   [line 524]

string Br( string $para)

Used to convert <br> in a docblock

Parameters:

string   $para     

[ Top ]

checkState   [line 3389]

void checkState( mixed $state)

Compare parserStringWithInlineTags::Convert() cache state to $state

Overridden in child classes as:

CHMdefaultConverter::checkState()
checks $state to see if it is the same as $local
HTMLdefaultConverter::checkState()
checks $state to see if it is the same as $local
HTMLframesConverter::checkState()
checks $state to see if it is the same as $local
HTMLSmartyConverter::checkState()
checks $state to see if it is the same as $local
XMLDocBookConverter::checkState()
checks $state to see if it is the same as $local

Parameters:

mixed   $state     

[ Top ]

Convert   [line 3185]

void Convert( mixed &$element)

Convert all elements to output format
  • Abstract:

Overridden in child classes as:

CHMdefaultConverter::Convert()
Convert abstract $element for template
HTMLdefaultConverter::Convert()
Convert abstract $element for template
HTMLframesConverter::Convert()
Convert abstract $element for template
HTMLSmartyConverter::Convert()
Convert abstract $element for template
PDFdefaultConverter::Convert()
Convert abstract $element for template
XMLDocBookConverter::Convert()
Convert abstract $element for template

Parameters:

mixed   &$element     parserElement descendant or parserPackagePage or parserData

[ Top ]

ConvertErrorLog   [line 1849]

void ConvertErrorLog( )


Overridden in child classes as:

CHMdefaultConverter::ConvertErrorLog()
Create errors.html template file output
HTMLdefaultConverter::ConvertErrorLog()
Create errors.html template file output
HTMLframesConverter::ConvertErrorLog()
Create errors.html template file output
HTMLSmartyConverter::ConvertErrorLog()
Create errors.html template file output
XMLDocBookConverter::ConvertErrorLog()
Create errors.html template file output

[ Top ]

ConvertTitle   [line 801]

string ConvertTitle( string $tag, array $attr, string $title, string $cdata)

Convert the title of a Tutorial docbook tag section

to a string based on the template options.ini


Parameters:

string   $tag     tag name
array   $attr     
string   $title     title text
string   $cdata     

[ Top ]

Convert_RIC   [line 3176]

void Convert_RIC( README|INSTALL|CHANGELOG $name, string $contents)

Convert README/INSTALL/CHANGELOG file contents to output format
  • Abstract:

Overridden in child classes as:

CHMdefaultConverter::Convert_RIC()
Convert README/INSTALL/CHANGELOG file contents to output format
HTMLframesConverter::Convert_RIC()
Convert README/INSTALL/CHANGELOG file contents to output format
HTMLSmartyConverter::Convert_RIC()
Convert README/INSTALL/CHANGELOG file contents to output format
PDFdefaultConverter::Convert_RIC()
Convert README/INSTALL/CHANGELOG file contents to output format

Parameters:

README|INSTALL|CHANGELOG   $name     
string   $contents     contents of the file

[ Top ]

copyFile   [line 3364]

void copyFile( string $file, [mixed $subdir = ''])

Copies a file from the template directory to the target directory

thanks to Robert Hoffmann for this fix


Parameters:

string   $file     

[ Top ]

createParentDir   [line 3282]

void createParentDir( string $dir)

Recursively creates all subdirectories that don't exist in the $dir path

Parameters:

string   $dir     

[ Top ]

EncloseList   [line 453]

string EncloseList( string $list, mixed $ordered)

Used to convert the contents of <ol> or <ul> in a docblock

Parameters:

string   $list     

[ Top ]

EncloseParagraph   [line 482]

string EncloseParagraph( string $para)

Used to enclose a paragraph in a docblock

Parameters:

string   $para     

[ Top ]

endClass   [line 332]

void endClass( )

Called by walk() while converting, when the last class element has been parsed.

A Converter can use this method in any way it pleases. HTMLdefaultConverter uses it to complete the template for the class and to output its documentation


Overridden in child classes as:

CHMdefaultConverter::endClass()
Writes out the template file of $class_data and unsets the template to save memory
HTMLdefaultConverter::endClass()
Writes out the template file of $class_data and unsets the template to save memory
HTMLframesConverter::endClass()
Writes out the template file of $class_data and unsets the template to save memory
HTMLSmartyConverter::endClass()
Writes out the template file of $class_data and unsets the template to save memory
XMLDocBookConverter::endClass()
Writes out the template file of $class_data and unsets the template to save memory

[ Top ]

endPage   [line 344]

void endPage( )

Called by walk() while converting, when the last procedural page element has been parsed.

A Converter can use this method in any way it pleases. HTMLdefaultConverter uses it to complete the template for the procedural page and to output its documentation


Overridden in child classes as:

CHMdefaultConverter::endPage()
Writes out the template file of $page_data and unsets the template to save memory
HTMLdefaultConverter::endPage()
Writes out the template file of $page_data and unsets the template to save memory
HTMLframesConverter::endPage()
Writes out the template file of $page_data and unsets the template to save memory
HTMLSmartyConverter::endPage()
Writes out the template file of $page_data and unsets the template to save memory
XMLDocBookConverter::endPage()
Writes out the template file of $page_data and unsets the template to save memory

[ Top ]

formatIndex   [line 366]

void formatIndex( )

Called by walk() while converting.

This method is intended to be the place that $elements is formatted for output.


Overridden in child classes as:

CHMdefaultConverter::formatIndex()
HTMLdefaultConverter uses this function to format template index.html and packages.html
HTMLdefaultConverter::formatIndex()
HTMLdefaultConverter uses this function to format template index.html and packages.html
HTMLframesConverter::formatIndex()
HTMLdefaultConverter uses this function to format template index.html and packages.html
HTMLSmartyConverter::formatIndex()
HTMLdefaultConverter uses this function to format template index.html and packages.html
XMLDocBookConverter::formatIndex()
HTMLdefaultConverter uses this function to format template index.html and packages.html

[ Top ]

formatLeftIndex   [line 379]

void formatLeftIndex( )

Called by walk() while converting.

This method is intended to be the place that any of $class_elements, $function_elements, $page_elements, $define_elements, and $global_elements is formatted for output, depending on the value of $leftindex


Overridden in child classes as:

CHMdefaultConverter::formatLeftIndex()
Generate indexes for li_package.html and classtree output files
HTMLdefaultConverter::formatLeftIndex()
Generate indexes for li_package.html and classtree output files
HTMLframesConverter::formatLeftIndex()
Generate indexes for li_package.html and classtree output files
HTMLSmartyConverter::formatLeftIndex()
Generate indexes for li_package.html and classtree output files
XMLDocBookConverter::formatLeftIndex()
Generate indexes for li_package.html and classtree output files

[ Top ]

formatPkgIndex   [line 355]

void formatPkgIndex( )

Called by walk() while converting.

This method is intended to be the place that $pkg_elements is formatted for output.


Overridden in child classes as:

CHMdefaultConverter::formatPkgIndex()
HTMLdefaultConverter chooses to format both package indexes and the complete index here
HTMLdefaultConverter::formatPkgIndex()
HTMLdefaultConverter chooses to format both package indexes and the complete index here
HTMLframesConverter::formatPkgIndex()
HTMLdefaultConverter chooses to format both package indexes and the complete index here
HTMLSmartyConverter::formatPkgIndex()
HTMLdefaultConverter chooses to format both package indexes and the complete index here
XMLDocBookConverter::formatPkgIndex()
HTMLdefaultConverter chooses to format both package indexes and the complete index here

[ Top ]

formatTutorialTOC   [line 553]

string formatTutorialTOC( array $toc)

Creates a table of contents for a {@toc} inline tag in a tutorial

This function should return a formatted table of contents. By default, it does nothing, it is up to the converter to format the TOC


Overridden in child classes as:

HTMLframesConverter::formatTutorialTOC()
Use the template tutorial_toc.tpl to generate a table of contents for HTML
HTMLSmartyConverter::formatTutorialTOC()
Use the template tutorial_toc.tpl to generate a table of contents for HTML

Parameters:

array   $toc     format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...)

[ Top ]

getClassLink   [line 2494]

mixed getClassLink( string $expr, string $package, [mixed $file = false], [mixed $text = false])

return false or a classLink to $expr
  • Return: returns a classLink or false if the element is not found in package $package
  • See: classLink

Overridden in child classes as:

CHMdefaultConverter::getClassLink()
HTMLdefaultConverter::getClassLink()
HTMLframesConverter::getClassLink()
HTMLSmartyConverter::getClassLink()
PDFdefaultConverter::getClassLink()
XMLDocBookConverter::getClassLink()

Parameters:

string   $expr     class name
string   $package     package name

[ Top ]

getConverterDir   [line 3220]

string getConverterDir( )

Get the absolute path to the converter's base directory

[ Top ]

getDefineLink   [line 2550]

mixed getDefineLink( string $expr, string $package, [mixed $file = false], [mixed $text = false])

return false or a defineLink to $expr
  • Return: returns a defineLink or false if the element is not found in package $package
  • See: defineLink

Overridden in child classes as:

CHMdefaultConverter::getDefineLink()
HTMLdefaultConverter::getDefineLink()
HTMLframesConverter::getDefineLink()
HTMLSmartyConverter::getDefineLink()
PDFdefaultConverter::getDefineLink()
XMLDocBookConverter::getDefineLink()

Parameters:

string   $expr     constant name
string   $package     package name

[ Top ]

getFunctionLink   [line 2522]

mixed getFunctionLink( string $expr, string $package, [mixed $file = false], [mixed $text = false])

return false or a functionLink to $expr

Overridden in child classes as:

CHMdefaultConverter::getFunctionLink()
HTMLdefaultConverter::getFunctionLink()
HTMLframesConverter::getFunctionLink()
HTMLSmartyConverter::getFunctionLink()
PDFdefaultConverter::getFunctionLink()
XMLDocBookConverter::getFunctionLink()

Parameters:

string   $expr     function name
string   $package     package name

[ Top ]

getGlobalLink   [line 2578]

mixed getGlobalLink( string $expr, string $package, [mixed $file = false], [mixed $text = false])

return false or a globalLink to $expr
  • Return: returns a defineLink or false if the element is not found in package $package
  • See: defineLink

Overridden in child classes as:

CHMdefaultConverter::getGlobalLink()
HTMLdefaultConverter::getGlobalLink()
HTMLframesConverter::getGlobalLink()
HTMLSmartyConverter::getGlobalLink()
PDFdefaultConverter::getGlobalLink()
XMLDocBookConverter::getGlobalLink()

Parameters:

string   $expr     global variable name (with leading $)
string   $package     package name

[ Top ]

getGlobalValue   [line 3237]

string getGlobalValue( string $value)

Parse a global variable's default value for class initialization.

If a global variable's default value is "new class" as in:


1 $globalvar = new Parser
This method will document it not as "new Parser" but instead as "new Parser". For examples, see phpdoc.inc. Many global variables are classes, and phpDocumentor links to their documentation

  • Return: default global variable value with link to class if it's "new Class"

Parameters:

string   $value     default value of a global variable.

[ Top ]

getIncludeValue   [line 3264]

string getIncludeValue( string $value)

Parse an include's file to see if it is a file documented in this project

Although not very smart yet, this method will try to look for the included file file.ext:


1 include ("file.ext");
If it finds it, it will return a link to the file's documentation. For examples, see phpdoc.inc includes. Every include auto-links to the documentation for the file that is included

  • Return: included file with link to docs for file, if found

Parameters:

string   $value     file included by include statement.

[ Top ]

getLink   [line 2880]

mixed &getLink( string $expr, [string $package = false], [array $packages = false])

The meat of the @see tag and inline {@link} tag

$expr is a string with many allowable formats:

  1. proceduralpagename.ext
  2. constant_name
  3. classname::function()
  4. classname::$variablename
  5. classname
  6. function functionname()
  7. packagename#expr where expr is any of the above

New in version 1.1, you can explicitly specify a package to link to that is different from the current package. Use the # operator to specify a new package, as in tests#bug-540368.php (which should appear as a link like: "tests#bug-540368.php"). This example links to the procedural page bug-540368.php in package tests. Also, the "function" operator is now used to specifically link to a function instead of a method in the current class.


1 class myclass
2 {
3 // from inside the class definition, use "function conflict()" to refer to procedural function "conflict()"
4 function conflict()
5 {
6 }
7 }
8
9 function conflict()
10 {
11 }

If classname:: is not present, and the see tag is in a documentation block within a class, then the function uses the classname to search for $expr as a function or variable within classname, or any of its parent classes. given an $expr without '$', '::' or '()' getLink first searches for classes, procedural pages, constants, global variables, and then searches for methods and variables within the default class, and finally for any function


Overridden in child classes as:

XMLDocBookConverter::getLink()
do that stuff in $template_options

Parameters:

string   $expr     expression to search for a link
string   $package     package to start searching in
array   $packages     list of all packages to search in

[ Top ]

getMethodLink   [line 2635]

mixed getMethodLink( string $expr, string $class, string $package, [mixed $file = false], [mixed $text = false])

return false or a methodLink to $expr in $class
  • Return: returns a methodLink or false if the element is not found in package $package, class $class
  • See: methodLink

Overridden in child classes as:

CHMdefaultConverter::getMethodLink()
HTMLdefaultConverter::getMethodLink()
HTMLframesConverter::getMethodLink()
HTMLSmartyConverter::getMethodLink()
PDFdefaultConverter::getMethodLink()
XMLDocBookConverter::getMethodLink()

Parameters:

string   $expr     method name
string   $class     class name
string   $package     package name

[ Top ]

getPageLink   [line 2606]

mixed getPageLink( string $expr, string $package, [mixed $path = false], [mixed $text = false], [mixed $packages = false])

return false or a pageLink to $expr
  • Return: returns a pageLink or false if the element is not found in package $package
  • See: pageLink

Overridden in child classes as:

CHMdefaultConverter::getPageLink()
HTMLdefaultConverter::getPageLink()
HTMLframesConverter::getPageLink()
HTMLSmartyConverter::getPageLink()
PDFdefaultConverter::getPageLink()
XMLDocBookConverter::getPageLink()

Parameters:

string   $expr     procedural page name
string   $package     package name

[ Top ]

getPPageId   [line 819]

void getPPageId( mixed $package, mixed $subpackage, mixed $tutorial, mixed $id)

Used by {@id}

Overridden in child classes as:

CHMdefaultConverter::getPPageId()
HTMLframesConverter::getPPageId()
HTMLSmartyConverter::getPPageId()
PDFdefaultConverter::getPPageId()
XMLDocBookConverter::getPPageId()

[ Top ]

getSortedClassTreeFromClass   [line 2269]

array getSortedClassTreeFromClass( string $class, string $package, string $subpackage)

Return a tree of all classes that extend this class

The data structure returned is designed for a non-recursive algorithm, and is somewhat complex. In most cases, the array returned is:

 array('#root' => array('link' =>  to $class,
                        'parent' => false,
                        'children' => array(array('class' => 'childclass1', 'package' => 'child1package'),
                                            array('class' => 'childclass2', 'package' => 'child2package'),...
                                           )
                       ),
       'child1package#childclass1' => array('link' =>  to childclass1,
                                            'parent' => '#root',
                                            'children' => array(array('class' => 'kidclass', 'package' => 'kidpackage'),...
                                                               )
                                           ),
       'kidpackage#kidclass' => array('link' =>  to kidclass,
                                      'parent' => 'child1package#childclass1',
                                      'children' => array() // no children
                                     ),
      ....
      )

To describe this format using language, every class in the tree has an entry in the first level of the array. The index for all child classes that extend the root class is childpackage#childclassname. Each entry in the array has 3 elements: link, parent, and children.

  • link - a classLink to the current class
  • parent - a classLink to the class's parent, or false (except for one special case described below)
  • children - an array of arrays, each entry has a 'class' and 'package' index to the child class, used to find the entry in the big array

special cases are when the #root class has a parent in another package, or when the #root class extends a class not found by phpDocumentor. In the first case, parent will be a classLink to the parent class. In the second, parent will be the extends clause, as in:


1 class X extends Y
2 {
3 ...
4 }
in this case, the #root entry will be array('link' => classLink to X, 'parent' => 'Y', children => array(...))

The fastest way to design a method to process the array returne is to copy HTMLframesConverter::getRootTree() into your converter and to modify the html to whatever output format you are going to use


Parameters:

string   $class     class name
string   $package     
string   $subpackage     

[ Top ]

getSourceLink   [line 608]

string getSourceLink( mixed $path)

  • Return: an output-format dependent link to phpxref-style highlighted source code
  • Abstract:

Overridden in child classes as:

HTMLframesConverter::getSourceLink()
HTMLSmartyConverter::getSourceLink()

[ Top ]

getState   [line 3378]

void getState( )

Return parserStringWithInlineTags::Convert() cache state

Overridden in child classes as:

CHMdefaultConverter::getState()
returns $local
HTMLdefaultConverter::getState()
returns $local
HTMLframesConverter::getState()
returns $local
HTMLSmartyConverter::getState()
returns $local
PDFdefaultConverter::getState()
XMLDocBookConverter::getState()
returns $local

[ Top ]

getTutorialLink   [line 2733]

tutorialLink|string getTutorialLink( string $expr, [string $package = false], [string $subpackage = false], [array $packages = false])

The meat of the @tutorial tag and inline { @tutorial} tag

Take a string and return an abstract link to the tutorial it represents. Since tutorial naming literally works like the underlying filesystem, the way to reference the tutorial is similar. Tutorials are located in a subdirectory of any directory parsed, which is named 'tutorials/' (we try to make things simple when we can :). They are further organized by package and subpackage as:

tutorials/package/subpackage

and the files are named *.cls, *.pkg, or *.proc, and so a link to a tutorial named file.cls can be referenced (depending on context) as any of:


1 * @tutorial package/subpackage/file.cls
2 * @tutorial package/file.cls
3 * @tutorial file.cls

The first case will only be needed if file.cls exists in both the current package, in anotherpackage/file.cls and in anotherpackage/subpackage/file.cls and you wish to reference the one in anotherpackage/subpackage. The second case is only needed if you wish to reference file.cls in another package and it is unique in that package. the third will link to the first file.cls it finds using this search method:

  1. current package/subpackage
  2. all other subpackages of current package
  3. parent package, if this package has classes that extend classes in another package
  4. all other packages

  • Return: returns either a link, or the original text, if not found
  • Since: 1.2

Parameters:

string   $expr     the original expression
string   $package     package to look in first
string   $subpackage     subpackage to look in first
array   $packages     array of package names to search in if not found in parent packages. This is used to limit the search, phpDocumentor automatically searches all packages

[ Top ]

getTutorialTree   [line 1345]

void getTutorialTree( parserTutorial|array $tutorial)


Overridden in child classes as:

HTMLframesConverter::getTutorialTree()
HTMLSmartyConverter::getTutorialTree()

Parameters:

parserTutorial|array   $tutorial     

[ Top ]

getVarLink   [line 2666]

mixed getVarLink( string $expr, string $class, string $package, [mixed $file = false], [mixed $text = false])

return false or a varLink to $expr in $class
  • Return: returns a varLink or false if the element is not found in package $package, class $class
  • See: varLink

Overridden in child classes as:

CHMdefaultConverter::getVarLink()
HTMLdefaultConverter::getVarLink()
HTMLframesConverter::getVarLink()
HTMLSmartyConverter::getVarLink()
PDFdefaultConverter::getVarLink()
XMLDocBookConverter::getVarLink()

Parameters:

string   $expr     var name
string   $class     class name
string   $package     package name

[ Top ]

hasTutorial   [line 317]

false|parserTutorial hasTutorial( pkg|cls|proc $type, tutorial $name, string $package, [string $subpackage = ''])

  • Return: if the tutorial exists, return it

Parameters:

pkg|cls|proc   $type     the tutorial type to search for
tutorial   $name     name
string   $package     package name
string   $subpackage     subpackage name, if any

[ Top ]

highlightSource   [line 403]

string highlightSource( integer $token, mixed $word)

Called by parserSourceInlineTag::arrayConvert() to allow converters to format the source code the way they'd like.

default returns it unchanged


Overridden in child classes as:

HTMLframesConverter::highlightSource()
Called by parserSourceInlineTag::arrayConvert() to allow converters to format the source code the way they'd like.
HTMLSmartyConverter::highlightSource()
Called by parserSourceInlineTag::arrayConvert() to allow converters to format the source code the way they'd like.
PDFdefaultConverter::highlightSource()
Called by parserSourceInlineTag::arrayConvert() to allow converters to format the source code the way they'd like.

Parameters:

integer   $token     token value from http://www.php.net/tokenizer

[ Top ]

Italicize   [line 510]

string Italicize( string $para)

Used to convert the contents of <i> in a docblock

Parameters:

string   $para     

[ Top ]

ListItem   [line 439]

string ListItem( string $item)

Used to convert the contents of <li> in a docblock

Parameters:

string   $item     

[ Top ]

Output   [line 3194]

void Output( mixed $title)

do all necessary output

Overridden in child classes as:

CHMdefaultConverter::Output()
This function will be used by CHMdefaultConverter to call html help compiler
HTMLdefaultConverter::Output()
This function is not used by HTMLdefaultConverter, but is required by Converter
HTMLframesConverter::Output()
This function is not used by HTMLdefaultConverter, but is required by Converter
HTMLSmartyConverter::Output()
This function is not used by HTMLdefaultConverter, but is required by Converter
PDFdefaultConverter::Output()
calls Cezpdf::ezOutput() and writes documentation.pdf to targetDir
XMLDocBookConverter::Output()
This function is not used by HTMLdefaultConverter, but is required by Converter

[ Top ]

postProcess   [line 539]

string postProcess( mixed $text)

This version does nothing

Perform necessary post-processing of string data. For example, the HTML Converters should escape < and > to become &lt; and &gt;


Overridden in child classes as:

CHMdefaultConverter::postProcess()
HTMLdefaultConverter::postProcess()
HTMLframesConverter::postProcess()
HTMLSmartyConverter::postProcess()
XMLDocBookConverter::postProcess()

[ Top ]

PreserveWhiteSpace   [line 468]

string PreserveWhiteSpace( string $string)

Used to convert the contents of &lt;pre> in a docblock

Parameters:

string   $string     

[ Top ]

ProgramExample   [line 425]

string ProgramExample( string $example)

Used to convert the &lt;code> tag in a docblock

Overridden in child classes as:

CHMdefaultConverter::ProgramExample()
HTMLframesConverter::ProgramExample()
HTMLSmartyConverter::ProgramExample()

Parameters:

string   $example     

[ Top ]

returnLink   [line 3155]

string returnLink( string $link, string $text)

take URL $link and text $text and return a link in the format needed for the Converter
  • Return: link to $link
  • Abstract:

Overridden in child classes as:

CHMdefaultConverter::returnLink()
HTMLdefaultConverter::returnLink()
HTMLframesConverter::returnLink()
HTMLSmartyConverter::returnLink()
PDFdefaultConverter::returnLink()
XMLDocBookConverter::returnLink()

Parameters:

string   $link     URL
string   $text     text to display

[ Top ]

returnSee   [line 3166]

string returnSee( abstractLink &$element, [string $eltext = false])

take abstractLink descendant and text $eltext and return a link in the format needed for the Converter
  • Return: link to $element
  • Abstract:

Overridden in child classes as:

CHMdefaultConverter::returnSee()
This function takes an abstractLink descendant and returns an html link
HTMLdefaultConverter::returnSee()
This function takes an abstractLink descendant and returns an html link
HTMLframesConverter::returnSee()
This function takes an abstractLink descendant and returns an html link
HTMLSmartyConverter::returnSee()
This function takes an abstractLink descendant and returns an html link
PDFdefaultConverter::returnSee()
Returns a bookmark using Cezpdf 009
XMLDocBookConverter::returnSee()
This function takes an abstractLink descendant and returns an html link

Parameters:

abstractLink   &$element     
string   $eltext     

[ Top ]

setTargetDir   [line 3307]

void setTargetDir( string $dir)

Sets the output directory for generated documentation

Overridden in child classes as:

CHMdefaultConverter::setTargetDir()
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
HTMLdefaultConverter::setTargetDir()
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
HTMLframesConverter::setTargetDir()
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
HTMLSmartyConverter::setTargetDir()
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
XMLDocBookConverter::setTargetDir()
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied

Parameters:

string   $dir     the output directory

[ Top ]

setTemplateDir   [line 3204]

void setTemplateDir( string $dir)

sets the template directory based on the $outputformat and $name

Also sets $templateName to the $dir parameter


Overridden in child classes as:

CHMdefaultConverter::setTemplateDir()
HTMLframesConverter::setTemplateDir()
HTMLSmartyConverter::setTemplateDir()
PDFdefaultConverter::setTemplateDir()
XMLDocBookConverter::setTemplateDir()

Parameters:

string   $dir     subdirectory

[ Top ]

sortPageContentsByElementType   [line 1941]

void sortPageContentsByElementType( mixed &$pages)

sorts $page_contents by element type as well as alphabetically
  • See: $sort_page_contents_by_element_type

[ Top ]

sourceLine   [line 618]

string sourceLine( integer $linenumber, string $line)

  • Return: formatted source code line with line number

Parameters:

integer   $linenumber     line number
string   $line     highlighted source code line

[ Top ]

TranslateTag   [line 632]

string TranslateTag( string $name, string $attr, string $cdata)

Used to translate an xml DocBook tag from a tutorial by reading the options.ini file for the template.

Parameters:

string   $name     tag name
string   $attr     any attributes Format: array(name => value)
string   $cdata     the tag contents, if any

[ Top ]

type_adjust   [line 415]

string type_adjust( string $typename)

Called by parserReturnTag::Convert() to allow converters to change type names to desired formatting

Used by XMLDocBookConverter::type_adjust() to change true and false to the peardoc2 values


Overridden in child classes as:

XMLDocBookConverter::type_adjust()

Parameters:

string   $typename     

[ Top ]

unmangle   [line 391]

string unmangle( string $sourcecode)

Called by parserSourceInlineTag::stringConvert() to allow converters to format the source code the way they'd like.

default returns it unchanged (html with xhtml tags)


Overridden in child classes as:

CHMdefaultConverter::unmangle()
HTMLdefaultConverter::unmangle()
HTMLframesConverter::unmangle()
HTMLSmartyConverter::unmangle()
PDFdefaultConverter::unmangle()
XMLDocBookConverter::unmangle()

Parameters:

string   $sourcecode     output from highlight_string() - use this function to reformat the returned data for Converter-specific output

[ Top ]

vardump_tree   [line 1491]

void vardump_tree( mixed $tree, [mixed $indent = ''])

Debugging function for dumping $tutorial_tree

[ Top ]

walk   [line 1094]

void walk( array &$pages, array &$package_pages)

called by phpDocumentor_IntermediateParser::Convert() to traverse the array of pages and their elements, converting them to the output format

The walk() method should be flexible enough such that it never needs modification. walk() sets up all of the indexes, and sorts everything in logical alphabetical order. It then passes each element individually to Convert(), a method that must be overridden in a child Converter.

walk() first creates all of the indexes $elements, $pkg_elements and the left indexes specified by $leftindexes, and then sorts them by calling sortIndexes(). After this, it passes all package-level docs to Convert(). Then, it calls the index sorting functions formatPkgIndex(), formatIndex() and formatLeftIndex().

Finally, it converts each procedural page in alphabetical order. This stage passes elements from the physical file to Convert() in alphabetical order. First, procedural page elements parserDefine, parserInclude, parserGlobal, and parserFunction are passed to Convert(). Then, class elements are passed in this order: parserClass, then all of the parserVars in the class and all of the parserMethods in the class. Classes are in alphabetical order, and both vars and methods are in alphabetical order.

Finally, ConvertErrorLog() is called and the data walk is complete.

  • Uses: Converter::_createPkgElements()

Parameters:

array   &$pages     Format: array(fullpath => parserData structure with full parserData::$elements and parserData::$class_elements.
array   &$package_pages     Format: array(parserPackagePage 1, parserPackagePage 2,...)

[ Top ]

walk_everything   [line 1706]

void walk_everything( )

walk over elements by package rather than page

[ Top ]

writeExample   [line 598]

void writeExample( string $title, string $path, string $source)

Write out the formatted source code for an example php file

This function provides the primary functionality for the @example tag.

  • Abstract:

Overridden in child classes as:

HTMLframesConverter::writeExample()
HTMLSmartyConverter::writeExample()

Parameters:

string   $title     example title
string   $path     example filename (no path)
string   $source     fully highlighted/linked source code of the file

[ Top ]

writeFile   [line 3341]

void writeFile( string $file, string $data, [boolean $binary = false])

Writes a file to target dir

Parameters:

string   $file     
string   $data     
boolean   $binary     true if the data is binary and not text

[ Top ]

writeSource   [line 567]

void writeSource( string $filepath, string $source)

Write out the formatted source code for a php file

This function provides the primary functionality for the @filesource tag.

  • Abstract:

Overridden in child classes as:

HTMLframesConverter::writeSource()
HTMLSmartyConverter::writeSource()

Parameters:

string   $filepath     full path to the file
string   $source     fully highlighted/linked source code of the file

[ Top ]

writeSourceFunction   [line 583]

void writeSourceFunction( string $function, string $path, string $source)

Write out the formatted source code for a function

This function provides the primary functionality for the tags.source.pkg tag.

  • Abstract:

Parameters:

string   $function     function name
string   $path     full path of file that contains function
string   $source     fully highlighted/linked source code of the function

[ Top ]


Documentation generated on Fri, 30 Apr 2004 22:09:25 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.