Class: XMLDocBookConverter
Source Location: /phpDocumentor/Converters/XML/DocBook/XMLDocBookConverter.inc
Class XMLDocBookConverter
Inherited Properties, Constants, and Methods
Property Summary
string |
$base_dir |
target directory passed on the command-line. |
string |
$class |
name of current class being converted |
Template |
$class_data |
template for the class currently being processed |
string |
$class_dir |
output directory for the current class being processed |
array |
$current |
contains all of the template procedural page element loop data needed for the current template |
array |
$currentclass |
contains all of the template class element loop data needed for the current template |
boolean |
$juststarted |
controls formatting of parser informative output |
array |
$leftindex |
indexes of elements by package that need to be generated |
boolean |
$local |
whether a @see is going to be in the $base_dir, or in a package/subpackage subdirectory of $base_dir |
string |
$page |
name of current page being converted |
Template |
$page_data |
template for the procedural page currently being processed |
string |
$page_dir |
output directory for the current procedural page being processed |
string |
$path |
path of current page being converted |
Method Summary
void |
convertGlobal() |
Converts global variables for template output |
void |
convertPackagePage() |
Converts package page and sets its package as used in $package_pages |
void |
convertPage() |
converts procedural pages for template output |
void |
convertVar() |
Converts class variables for template output. |
void |
endClass() |
Writes out the template file of $class_data and unsets the template to save memory |
void |
endPage() |
Writes out the template file of $page_data and unsets the template to save memory |
void |
formatIndex() |
HTMLdefaultConverter uses this function to format template index.html and packages.html |
void |
formatLeftIndex() |
Generate indexes for li_package.html and classtree output files |
void |
formatPkgIndex() |
HTMLdefaultConverter chooses to format both package indexes and the complete index here |
string |
getId() |
Get the id value needed to allow linking |
void |
&getLink() |
do that stuff in $template_options |
string |
getRootTree() |
return formatted class tree for the Class Trees page |
void |
Output() |
This function is not used by HTMLdefaultConverter, but is required by Converter |
int |
rcNatCmp() |
does a nat case sort on the specified second level value of the array |
int |
rcNatCmp1() |
does a nat case sort on the specified second level value of the array. |
void |
setTargetDir() |
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied |
Properties
target directory passed on the command-line.
$targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
name of current class being converted
Redefinition of:
- Converter::$class
- set to a classname if currently parsing a class, false if not
template for the class currently being processed
Redefinition of:
- Converter::$class_data
- template for the class currently being processed
output directory for the current class being processed
contains all of the template procedural page element loop data needed for the current template
contains all of the template class element loop data needed for the current template
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
indexes of elements by package that need to be generated
Redefinition of:
- Converter::$leftindex
- Controls which of the one-element-only indexes are generated.
whether a @see is going to be in the $base_dir, or in a package/subpackage subdirectory of $base_dir
array of converted package page names.
Used to link to the package page in the left index
name of current page being converted
Redefinition of:
- Converter::$page
- name of current page being converted
template for the procedural page currently being processed
Redefinition of:
- Converter::$page_data
- template for the procedural page currently being processed
output directory for the current procedural page being processed
path of current page being converted
Redefinition of:
- Converter::$path
- path of current page being converted
XMLDocBookConverter wants elements sorted by type as well as alphabetically
API Tags:
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
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
Methods
XMLDocBookConverter XMLDocBookConverter(
&$allp,
&$packp,
&$classes,
&$procpages,
$po,
$pp,
$qm,
$targetDir,
$templateDir,
$title
)
|
|
sets $base_dir to $targetDir
Parameters:
|
&$allp: |
|
|
&$packp: |
|
|
&$classes: |
|
|
&$procpages: |
|
|
$po: |
|
|
$pp: |
|
|
$qm: |
|
|
$targetDir: |
|
|
$templateDir: |
|
|
$title: |
|
API Tags:
Converts defines for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertDefine()
- Converts defines for template output
Create errors.html template file output
This method takes all parsing errors and warnings and spits them out ordered by file and line number.
API Tags:
Global: | ErrorTracker $phpDocumentor_errors: We'll be using it's output facility |
Redefinition of:
- Converter::ConvertErrorLog()
- Convert the phpDocumentor parsing/conversion error log
Converts function for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertFunction()
- Converts function for template output
Converts global variables for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertGlobal()
- Converts global variables for template output
Converts include elements for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertInclude()
- Converts includes for template output
Converts method for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertMethod()
- Converts method for template output
Converts package page and sets its package as used in $package_pages
Parameters:
converts procedural pages for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertPage()
- Default Page Handler
Converts class variables for template output.
Parameters:
API Tags:
Redefinition of:
- Converter::convertVar()
- Converts class variables for template output.
Writes out the template file of $class_data and unsets the template to save memory
API Tags:
Redefinition of:
- Converter::endClass()
- Called by walk() while converting, when the last class element has been parsed.
Writes out the template file of $page_data and unsets the template to save memory
API Tags:
Redefinition of:
- Converter::endPage()
- Called by walk() while converting, when the last procedural page element has been parsed.
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.
API Tags:
Global: | string $phpDocumentor_DefaultPackageName: Used to set the starting package to display |
Redefinition of:
- Converter::formatIndex()
- Called by walk() while converting.
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
API Tags:
Redefinition of:
- Converter::formatLeftIndex()
- Called by walk() while converting.
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
API Tags:
Redefinition of:
- Converter::formatPkgIndex()
- Called by walk() while converting.
void generateElementIndex(
)
|
|
Generate alphabetical index of all elements
API Tags:
returns an array containing the class inheritance tree from the root object to the class
Parameters:
API Tags:
Redefinition of:
- Converter::generateFormattedClassTree()
- returns an array containing the class inheritance tree from the root object to the class.
void generateFormattedClassTrees(
string
$package
)
|
|
returns a template-enabled array of class trees
Parameters:
string |
$package: |
package to generate a class tree for |
API Tags:
See: | $roots, HTMLConverter::getRootTree() |
void generatePkgElementIndex(
string
$package
)
|
|
Generate alphabetical index of all elements by package and subpackage
Parameters:
string |
$package: |
name of a package |
API Tags:
void generatePkgElementIndexes(
)
|
|
API Tags:
mixed getClassLink(
string
$expr, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true], [
$with_a = true]
)
|
|
Parameters:
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: |
|
API Tags:
Redefinition of:
- Converter::getClassLink()
- return false or a classLink to $expr
mixed getDefineLink(
string
$expr, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getDefineLink()
- return false or a defineLink to $expr
mixed getFunctionLink(
string
$expr, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getFunctionLink()
- return false or a functionLink to $expr
mixed getGlobalLink(
string
$expr, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getGlobalLink()
- return false or a globalLink to $expr
string getId(
mixed
&$el
)
|
|
Get the id value needed to allow linking
Parameters:
mixed |
&$el: |
descendant of parserElement or parserData/parserPage |
API Tags:
Redefinition of:
- Converter::getId()
- take abstractLink descendant and text $eltext and return a
void &getLink(
$expr, [
$package = false], [
$packages = false]
)
|
|
do that stuff in $template_options
Parameters:
|
$expr: |
|
|
$package: |
|
|
$packages: |
|
Redefinition of:
- Converter::getLink()
- The meat of the @see tag and inline {@link} tag
mixed getMethodLink(
string
$expr, string
$class, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getMethodLink()
- return false or a methodLink to $expr in $class
mixed getPageLink(
string
$expr, string
$package, [string
$path = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getPageLink()
- return false or a pageLink to $expr
void getPageName(
&$element
)
|
|
Parameters:
string getRootTree(
array
$tree,
$package
)
|
|
return formatted class tree for the Class Trees page
Parameters:
API Tags:
void getTutorialId(
$package,
$subpackage,
$tutorial,
$id
)
|
|
Parameters:
|
$package: |
|
|
$subpackage: |
|
|
$tutorial: |
|
|
$id: |
|
Redefinition of:
- Converter::getTutorialId()
- Return a converter-specific id to distinguish tutorials and their sections
mixed getVarLink(
string
$expr, string
$class, string
$package, [string
$file = false], [boolean
$text = false], [boolean
$local = true]
)
|
|
Parameters:
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 |
API Tags:
Redefinition of:
- Converter::getVarLink()
- return false or a varLink to $expr in $class
This function is not used by HTMLdefaultConverter, but is required by Converter
Redefinition of:
- Converter::Output()
- do all necessary output
void prepareDocBlock(
&$element, [
$nopackage = true]
)
|
|
Parameters:
Redefinition of:
- Converter::prepareDocBlock()
- convert the element's DocBlock for output
int rcNatCmp(
mixed
$a, mixed
$b
)
|
|
does a nat case sort on the specified second level value of the array
Parameters:
int rcNatCmp1(
mixed
$a, mixed
$b
)
|
|
does a nat case sort on the specified second level value of the array.
this one puts constructors first
Parameters:
string returnLink(
string
$link, string
$text
)
|
|
Parameters:
string |
$link: |
|
string |
$text: |
|
API Tags:
Return: | <ulink url="'.$link.'">'.$text.'</ulink> |
Redefinition of:
- Converter::returnLink()
- take URL $link and text $text and return a link in the format needed for the Converter
void returnSee(
abstractLink
&$element, [string
$eltext = false], [boolean
$local = true], [boolean
$with_a = true]
)
|
|
This function takes an abstractLink descendant and returns an html link
Parameters:
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 <a> tag |
Redefinition of:
- Converter::returnSee()
- take abstractLink descendant and text $eltext and return a link
void setTargetDir(
$dir
)
|
|
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
Parameters:
API Tags:
Redefinition of:
- Converter::setTargetDir()
- Sets the output directory for generated documentation
void setTemplateDir(
$dir
)
|
|
Parameters:
Redefinition of:
- Converter::setTemplateDir()
- sets the template directory based on the $outputformat and $name
void &SmartyInit(
&$templ
)
|
|
Parameters:
void writeNewPPage(
$key
)
|
|
Parameters:
|
|