Class XMLDocBookConverter

Description

XML DocBook converter.

This Converter takes output from the Parser and converts it to DocBook output

Located in /phpDocumentor/Converters/XML/DocBook/XMLDocBookConverter.inc (line 43)

Converter
   |
   --XMLDocBookConverter
Variable Summary
string $base_dir
string $category
string $class
Template $class_data
string $class_dir
array $current
boolean $juststarted
array $leftindex
boolean $local
mixed $method_data
string $name
string $outputformat
string $page
Template $page_data
string $page_dir
string $path
mixed $sourceloc
Method Summary
XMLDocBookConverter XMLDocBookConverter ( &$allp,  &$packp,  &$classes,  &$procpages,  $po,  $pp,  $qm,  $targetDir,  $templateDir,  $title)
void convertClass (parserClass &$element)
void convertDefine (parserDefine &$element)
void ConvertErrorLog ()
void convertFunction (parserFunction &$element)
void convertGlobal (parserGlobal &$element)
void convertInclude (parserInclude &$element)
void convertMethod (parserMethod &$element)
void convertPage (parserData &$element)
void convertTutorial ( &$element)
void convertVar (parserVar &$element)
void endClass ()
void endPage ()
void formatIndex ()
void formatLeftIndex ()
void formatPkgIndex ()
void generateFormattedClassTrees (string $package)
void generatePkgElementIndex (string $package)
void getCData ( $value)
mixed getClassLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true], [ $with_a = true])
mixed getDefineLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
mixed getFunctionLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
mixed getGlobalLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
string getId (mixed &$el)
void &getLink ( $expr, [ $package = false], [ $packages = false])
mixed getMethodLink (string $expr, string $class, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
mixed getPageLink (string $expr, string $package, [string $path = false], [boolean $text = false], [boolean $local = true])
void getPageName ( &$element)
string getRootTree (array $tree,  $package)
void getTutorialId ( $package,  $subpackage,  $tutorial,  $id)
mixed getVarLink (string $expr, string $class, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
void makeLeft ()
void Output ()
void postProcess ( $text)
void prepareDocBlock ( &$element, [ $nopackage = true])
int rcNatCmp (mixed $a, mixed $b)
int rcNatCmp1 (mixed $a, mixed $b)
string returnLink (string $link, string $text)
void returnSee (abstractLink &$element, [string $eltext = false], [boolean $local = true], [boolean $with_a = true])
void setTargetDir ( $dir)
void setTemplateDir ( $dir)
void &SmartyInit ( &$templ)
void type_adjust ( $typename)
void unmangle ( $s,  $sourcecode)
void writeNewPPage ( $key)
Variables
string $base_dir (line 101)

target directory passed on the command-line.

$targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.

string $category (line 162)

peardoc2 Category

string $class (line 82)

name of current class being converted


Redefinition of:
Converter::$class
set to a classname if currently parsing a class, false if not
Template $class_data (line 113)

template for the class currently being processed


Redefinition of:
Converter::$class_data
template for the class currently being processed
string $class_dir (line 107)

output directory for the current class being processed

array $current (line 138)

contains all of the template procedural page element loop data needed for the current template

array $currentclass (line 144)

contains all of the template class element loop data needed for the current template

mixed $function_data = array() (line 155)
boolean $juststarted = false (line 132)

controls formatting of parser informative output

Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic

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

indexes of elements by package that need to be generated


Redefinition of:
Converter::$leftindex
Controls which of the one-element-only indexes are generated.
boolean $local = true (line 64)

whether a @see is going to be in the $base_dir, or in a package/subpackage subdirectory of $base_dir

mixed $method_data = array() (line 156)
string $name = 'DocBook' (line 54)
string $outputformat = 'XML' (line 52)

Redefinition of:
Converter::$outputformat
output format of this converter
array $package_pages = array() (line 120)

array of converted package page names.

Used to link to the package page in the left index

  • var: Format: array(package => 1)
string $page (line 70)

name of current page being converted


Redefinition of:
Converter::$page
name of current page being converted
Template $page_data (line 88)

template for the procedural page currently being processed


Redefinition of:
Converter::$page_data
template for the procedural page currently being processed
string $page_dir (line 94)

output directory for the current procedural page being processed

string $path (line 76)

path of current page being converted


Redefinition of:
Converter::$path
path of current page being converted
boolean $sort_page_contents_by_type = true (line 50)

XMLDocBookConverter wants elements sorted by type as well as alphabetically


Redefinition of:
Converter::$sort_page_contents_by_type
This determines whether the $page_contents array should be sorted by element type as well as alphabetically by name
mixed $sourceloc = '' (line 157)
array $template_options = array('usepear' => false) (line 153)

template options. Currently only 1 recognized option usepear

usepear tells the getLink() function to return a package link to PEAR and PEAR_ERROR if possible, and to link directly to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once!


Redefinition of:
Converter::$template_options
Options for each template, parsed from the options.ini file in the template base directory

Inherited Variables

Inherited from Converter

Converter::$all_packages
Converter::$classes
Converter::$class_contents
Converter::$class_elements
Converter::$curfile
Converter::$curpage
Converter::$define_elements
Converter::$elements
Converter::$function_elements
Converter::$global_elements
Converter::$highlightingSource
Converter::$package
Converter::$packagecategories
Converter::$package_elements
Converter::$package_output
Converter::$package_parents
Converter::$page_contents
Converter::$page_elements
Converter::$parseprivate
Converter::$pkg_elements
Converter::$processSpecialRoots
Converter::$quietmode
Converter::$smarty_dir
Converter::$sort_absolutely_everything
Converter::$sourcePaths
Converter::$subpackage
Converter::$targetDir
Converter::$templateDir
Converter::$templateName
Converter::$title
Converter::$todoList
Methods
Constructor XMLDocBookConverter (line 167)

sets $base_dir to $targetDir

XMLDocBookConverter XMLDocBookConverter ( &$allp,  &$packp,  &$classes,  &$procpages,  $po,  $pp,  $qm,  $targetDir,  $templateDir,  $title)
  • &$allp
  • &$packp
  • &$classes
  • &$procpages
  • $po
  • $pp
  • $qm
  • $targetDir
  • $templateDir
  • $title
convertDefine (line 1021)

Converts defines for template output

void convertDefine (parserDefine &$element)

Redefinition of:
Converter::convertDefine()
Converts defines for template output
ConvertErrorLog (line 625)

Create errors.html template file output

This method takes all parsing errors and warnings and spits them out ordered by file and line number.

  • global: ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
void ConvertErrorLog ()

Redefinition of:
Converter::ConvertErrorLog()
Convert the phpDocumentor parsing/conversion error log
convertFunction (line 952)

Converts function for template output

void convertFunction (parserFunction &$element)

Redefinition of:
Converter::convertFunction()
Converts function for template output
convertGlobal (line 1040)

Converts global variables for template output

void convertGlobal (parserGlobal &$element)

Redefinition of:
Converter::convertGlobal()
Converts global variables for template output
convertInclude (line 1003)

Converts include elements for template output

void convertInclude (parserInclude &$element)

Redefinition of:
Converter::convertInclude()
Converts includes for template output
convertMethod (line 873)

Converts method for template output

void convertMethod (parserMethod &$element)

Redefinition of:
Converter::convertMethod()
Converts method for template output
convertPackagePage (line 712)

Converts package page and sets its package as used in $package_pages

void convertPackagePage (parserPackagePage &$element)
convertPage (line 1062)

converts procedural pages for template output

void convertPage (parserData &$element)

Redefinition of:
Converter::convertPage()
Default Page Handler
convertTutorial (line 736)
void convertTutorial ( &$element)
  • &$element

Redefinition of:
Converter::convertTutorial()
Default Tutorial Handler
convertVar (line 774)

Converts class variables for template output.

void convertVar (parserVar &$element)

Redefinition of:
Converter::convertVar()
Converts class variables for template output.
endClass (line 217)

Writes out the template file of $class_data and unsets the template to save memory

void endClass ()

Redefinition of:
Converter::endClass()
Called by walk() while converting, when the last class element has been parsed.
endPage (line 249)

Writes out the template file of $page_data and unsets the template to save memory

void endPage ()

Redefinition of:
Converter::endPage()
Called by walk() while converting, when the last procedural page element has been parsed.
formatIndex (line 360)

HTMLdefaultConverter uses this function to format template index.html and packages.html

This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors). Then it uses the default package name as the first package index to display. It sets the right pane to be either a blank file with instructions on making package-level docs, or the package-level docs for the default package.

  • global: string $phpDocumentor_DefaultPackageName: Used to set the starting package to display
void formatIndex ()

Redefinition of:
Converter::formatIndex()
Called by walk() while converting.
formatLeftIndex (line 438)

Generate indexes for li_package.html and classtree output files

This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). The $local parameter is set to false to ensure that paths are correct.

Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use

void formatLeftIndex ()

Redefinition of:
Converter::formatLeftIndex()
Called by walk() while converting.
formatPkgIndex (line 327)

HTMLdefaultConverter chooses to format both package indexes and the complete index here

This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory

void formatPkgIndex ()

Redefinition of:
Converter::formatPkgIndex()
Called by walk() while converting.
generateElementIndex (line 1260)

Generate alphabetical index of all elements

void generateElementIndex ()
generateFormattedClassTree (line 1122)

returns an array containing the class inheritance tree from the root object to the class

array generateFormattedClassTree (parserClass $class)

Redefinition of:
Converter::generateFormattedClassTree()
returns an array containing the class inheritance tree from the root object to the class.
generateFormattedClassTrees (line 1172)

returns a template-enabled array of class trees

  • see: $roots, HTMLConverter::getRootTree()
void generateFormattedClassTrees (string $package)
  • string $package: package to generate a class tree for
generatePkgElementIndex (line 1448)

Generate alphabetical index of all elements by package and subpackage

void generatePkgElementIndex (string $package)
  • string $package: name of a package
generatePkgElementIndexes (line 1588)
void generatePkgElementIndexes ()
getCData (line 703)
void getCData ( $value)
  • $value
getClassLink (line 1628)
mixed getClassLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true], [ $with_a = true])
  • string $expr: name of class
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag
  • $with_a

Redefinition of:
Converter::getClassLink()
return false or a classLink to $expr
getDefineLink (line 1660)
mixed getDefineLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of define
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getDefineLink()
return false or a defineLink to $expr
getFunctionLink (line 1644)
mixed getFunctionLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of function
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getFunctionLink()
return false or a functionLink to $expr
getGlobalLink (line 1676)
mixed getGlobalLink (string $expr, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of global variable
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getGlobalLink()
return false or a globalLink to $expr
getId (line 574)

Get the id value needed to allow linking

string getId (mixed &$el)
  • mixed &$el: descendant of parserElement or parserData/parserPage

Redefinition of:
Converter::getId()
take abstractLink descendant and text $eltext and return a
getLink (line 175)

do that stuff in $template_options

void &getLink ( $expr, [ $package = false], [ $packages = false])
  • $expr
  • $package
  • $packages

Redefinition of:
Converter::getLink()
The meat of the @see tag and inline {@link} tag
getMethodLink (line 1709)
mixed getMethodLink (string $expr, string $class, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of method
  • string $class: class containing method
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getMethodLink()
return false or a methodLink to $expr in $class
getPageLink (line 1692)
mixed getPageLink (string $expr, string $package, [string $path = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of procedural page
  • string $package: package name
  • string $path: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getPageLink()
return false or a pageLink to $expr
getPageName (line 1109)
void getPageName ( &$element)
  • &$element
getRootTree (line 1191)

return formatted class tree for the Class Trees page

string getRootTree (array $tree,  $package)
getTutorialId (line 696)
void getTutorialId ( $package,  $subpackage,  $tutorial,  $id)
  • $package
  • $subpackage
  • $tutorial
  • $id

Redefinition of:
Converter::getTutorialId()
Return a converter-specific id to distinguish tutorials and their sections
getVarLink (line 1726)
mixed getVarLink (string $expr, string $class, string $package, [string $file = false], [boolean $text = false], [boolean $local = true])
  • string $expr: name of var
  • string $class: class containing var
  • string $package: package name
  • string $file: full path to look in (used in index generation)
  • boolean $text: deprecated
  • boolean $local: return just the URL, or enclose it in an html a tag

Redefinition of:
Converter::getVarLink()
return false or a varLink to $expr in $class
makeLeft (line 282)
void makeLeft ()
Output (line 1783)

This function is not used by HTMLdefaultConverter, but is required by Converter

void Output ()

Redefinition of:
Converter::Output()
do all necessary output
postProcess (line 686)
void postProcess ( $text)
  • $text

Redefinition of:
Converter::postProcess()
This version does nothing
prepareDocBlock (line 691)
void prepareDocBlock ( &$element, [ $nopackage = true])
  • &$element
  • $nopackage

Redefinition of:
Converter::prepareDocBlock()
convert the element's DocBlock for output
rcNatCmp (line 1740)

does a nat case sort on the specified second level value of the array

int rcNatCmp (mixed $a, mixed $b)
  • mixed $a
  • mixed $b
rcNatCmp1 (line 1756)

does a nat case sort on the specified second level value of the array.

this one puts constructors first

int rcNatCmp1 (mixed $a, mixed $b)
  • mixed $a
  • mixed $b
returnLink (line 277)
  • return: &lt;ulink url="'.$link.'">'.$text.'</ulink&gt;
string returnLink (string $link, string $text)
  • string $link
  • string $text

Redefinition of:
Converter::returnLink()
take URL $link and text $text and return a link in the format needed for the Converter
returnSee (line 476)

This function takes an abstractLink descendant and returns an html link

void returnSee (abstractLink &$element, [string $eltext = false], [boolean $local = true], [boolean $with_a = true])
  • abstractLink &$element: a descendant of abstractlink should be passed, and never text
  • string $eltext: text to display in the link
  • boolean $local: this parameter is not used, and is deprecated
  • boolean $with_a: determines whether the returned text is enclosed in an &lt;a> tag

Redefinition of:
Converter::returnSee()
take abstractLink descendant and text $eltext and return a link
setTargetDir (line 1388)

calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied

void setTargetDir ( $dir)
  • $dir

Redefinition of:
Converter::setTargetDir()
Sets the output directory for generated documentation
setTemplateDir (line 1378)
void setTemplateDir ( $dir)
  • $dir

Redefinition of:
Converter::setTemplateDir()
sets the template directory based on the $outputformat and $name
SmartyInit (line 205)
void &SmartyInit ( &$templ)
  • &$templ
type_adjust (line 186)
void type_adjust ( $typename)
  • $typename

Redefinition of:
Converter::type_adjust()
Called by parserReturnTag::Convert() to allow converters to change type names to desired formatting
unmangle (line 180)
void unmangle ( $s,  $sourcecode)
  • $s
  • $sourcecode

Redefinition of:
Converter::unmangle()
Called by parserSourceInlineTag::stringConvert() to allow converters to format the source code the way they'd like.
writeNewPPage (line 406)
void writeNewPPage ( $key)
  • $key

Inherited Methods

Inherited From Converter

Converter::Converter()
Converter::AttrToString()
Converter::Bolden()
Converter::Br()
Converter::checkState()
Converter::cleanup()
Converter::Convert()
Converter::convertClass()
Converter::convertConst()
Converter::convertDefine()
Converter::ConvertErrorLog()
Converter::convertFunction()
Converter::convertGlobal()
Converter::convertInclude()
Converter::convertMethod()
Converter::convertPage()
Converter::ConvertTitle()
Converter::ConvertTodoList()
Converter::convertTutorial()
Converter::convertVar()
Converter::Convert_RIC()
Converter::copyFile()
Converter::createParentDir()
Converter::EncloseList()
Converter::EncloseParagraph()
Converter::endClass()
Converter::endPage()
Converter::exampleProgramExample()
Converter::flushHighlightCache()
Converter::formatIndex()
Converter::formatLeftIndex()
Converter::formatPkgIndex()
Converter::formatTutorialTOC()
Converter::generateChildClassList()
Converter::generateFormattedClassTree()
Converter::getClassesOnPage()
Converter::getClassLink()
Converter::getConstLink()
Converter::getConverterDir()
Converter::getCurrentPageLink()
Converter::getCurrentPageURL()
Converter::getDefineLink()
Converter::getFileSourceName()
Converter::getFileSourcePath()
Converter::getFormattedConflicts()
Converter::getFormattedDescMethods()
Converter::getFormattedDescVars()
Converter::getFormattedImplements()
Converter::getFormattedInheritedConsts()
Converter::getFormattedInheritedMethods()
Converter::getFormattedInheritedVars()
Converter::getFormattedMethodImplements()
Converter::getFormattedOverrides()
Converter::getFunctionLink()
Converter::getGlobalLink()
Converter::getGlobalValue()
Converter::getHighlightState()
Converter::getId()
Converter::getIncludeValue()
Converter::getLink()
Converter::getMethodLink()
Converter::getPageLink()
Converter::getSortedClassTreeFromClass()
Converter::getSourceLink()
Converter::getState()
Converter::getTutorialId()
Converter::getTutorialLink()
Converter::getTutorialTree()
Converter::getVarLink()
Converter::hasSourceCode()
Converter::hasTutorial()
Converter::highlightDocBlockSource()
Converter::highlightSource()
Converter::highlightTutorialSource()
Converter::Italicize()
Converter::Kbdize()
Converter::ListItem()
Converter::newSmarty()
Converter::Output()
Converter::postProcess()
Converter::prepareDocBlock()
Converter::PreserveWhiteSpace()
Converter::ProgramExample()
Converter::returnLink()
Converter::returnSee()
Converter::Sampize()
Converter::setSourcePaths()
Converter::setTargetDir()
Converter::setTemplateBase()
Converter::setTemplateDir()
Converter::sortPageContentsByElementType()
Converter::sourceLine()
Converter::startHighlight()
Converter::TranslateEntity()
Converter::TranslateTag()
Converter::TutorialExample()
Converter::type_adjust()
Converter::unmangle()
Converter::vardump_tree()
Converter::Varize()
Converter::walk()
Converter::walk_everything()
Converter::writeExample()
Converter::writeFile()
Converter::writeSource()
Converter::_rmdir()
Converter::_setHighlightCache()
Converter::_tutorial_path()

Documentation generated on Mon, 05 Dec 2011 21:12:34 -0600 by phpDocumentor 1.4.4