Class: XMLDocBookpeardoc2Converter
Source Location: /phpDocumentor/Converters/XML/DocBook/peardoc2/XMLDocBookpeardoc2Converter.inc
Class XMLDocBookpeardoc2Converter
Class Overview
XML DocBook converter.
This Converter takes output from the Parser and converts it to DocBook output for PEAR documentation. This Converter differs from the parent DocBook Converter in that it does not recognize the possibility of procedural pages or of functions! All functions must be defined as static methods for namespace purposes. In addition, all constants and global variables for a package are grouped together as per peardoc2 requirements. Include statements are not documented. If you want to document a normal project, don't use the peardoc2 converter, use the DocBook converter.
Located in /phpDocumentor/Converters/XML/DocBook/peardoc2/XMLDocBookpeardoc2Converter.inc [line 58]
Converter
|
--XMLDocBookpeardoc2Converter
Author(s):
Information Tags:
Version: | $Id: XMLDocBookpeardoc2Converter.inc,v 1.6 2006/10/24 04:18:14 cellog Exp $ |
Since: | 1.2 |
|
Properties
|
Methods
|
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 |
Smarty |
$packagexml |
Contents of the packagename.xml file are stored in this template variable |
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 |
convertFunction() |
Converts function for template output - does nothing in peardoc2! |
void |
convertGlobal() |
Converts global variables for template output |
void |
convertPage() |
converts procedural pages for template output |
void |
endClass() |
Writes out the template file of $class_data and unsets the template to save memory |
void |
formatLeftIndex() |
Creates package/lang/categoryname/packagename.xml for each package |
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() |
Generate the constants.xml, packagename.xml, and globals.xml files |
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 |
writeFile() |
Writes a file to target dir, beautify any .xml files first |
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
Contents of the packagename.xml file are stored in this template variable
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
This converter knows about the new root tree processing
In order to fix PEAR Bug #6389
Redefinition of:
- Converter::$processSpecialRoots
- This converter knows about the new root tree processing
Pass elements by package, simplifies generation of package.xml/category.xml
Redefinition of:
- Converter::$sort_absolutely_everything
- This is used if the content must be passed in the order it should be read, i.e. by package, procedural then classes
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
Constants, used for constants.tpl
Global Variables, used for globals.tpl
Methods
XMLDocBookpeardoc2Converter XMLDocBookpeardoc2Converter(
&$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:
void addSummaryToPackageXml(
$template_output
)
|
|
Parameters:
Parameters:
Redefinition of:
- Converter::Br()
- Used to convert <br> in a docblock
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 - does nothing in peardoc2!
Parameters:
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
Completely ignored by this converter
Parameters:
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
Does nothing - use tutorials for DocBook
Parameters:
converts procedural pages for template output
Parameters:
API Tags:
Redefinition of:
- Converter::convertPage()
- Default Page Handler
Does nothing in this converter
Parameters:
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:
Information Tags:
Todo: | move class summary into an array to be written out at the end of parsing each package |
Redefinition of:
- Converter::endClass()
- Called by walk() while converting, when the last class element has been parsed.
string exampleProgramExample(
string
$example, [boolean
$tutorial = false], [
$inlinesourceparse = null], [
$class = null], [
$linenum = null], [
$filesourcepath = null]
)
|
|
Used to convert the {@example} inline tag in a docblock.
By default, this just wraps ProgramExample
Parameters:
string |
$example: |
|
boolean |
$tutorial: |
true if this is to highlight a tutorial <programlisting> |
|
$inlinesourceparse: |
|
|
$class: |
|
|
$linenum: |
|
|
$filesourcepath: |
|
API Tags:
See: | XMLDocBookpeardoc2Converter::exampleProgramExample |
Redefinition of:
- Converter::exampleProgramExample()
- Used to convert the {@example} inline tag in a docblock.
Parameters:
parserClass|false |
$element: |
is false if this is the end of all conversion |
API Tags:
Creates package/lang/categoryname/packagename.xml for each package
Redefinition of:
- Converter::formatLeftIndex()
- Called by walk() while converting.
void generateElementIndex(
)
|
|
does nothing
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 generateFormattedInterfaceTrees(
string
$package
)
|
|
returns a template-enabled array of interface inheritance 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
void getExampleLink(
$unused,
$title
)
|
|
Parameters:
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, [boolean
$returnpackage = false]
)
|
|
Get the id value needed to allow linking
Parameters:
mixed |
&$el: |
descendant of parserElement or parserData/parserPage |
boolean |
$returnpackage: |
true to return the id for the package page |
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, string
$package, [
$noparent = false], boolean
$nounknownparent
)
|
|
return formatted class tree for the Class Trees page
Parameters:
array |
$tree: |
output from getSortedClassTreeFromClass() |
string |
$package: |
package |
boolean |
$nounknownparent: |
if true, an object's parent will not be checked |
|
$noparent: |
|
API Tags:
string getSourceAnchor(
string
$sourcefile, string
$anchor, [string
$text = ''], [boolean
$link = false]
)
|
|
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag.
NOTE: unused
Parameters:
string |
$sourcefile: |
full path to source file |
string |
$anchor: |
name of anchor |
string |
$text: |
link text, if this is a link |
boolean |
$link: |
returns either a link or a destination based on this parameter |
API Tags:
Return: | link to an anchor, or the anchor |
void getTutorialId(
$package,
$subpackage,
$tutorial,
$id,
$category
)
|
|
Parameters:
|
$package: |
|
|
$subpackage: |
|
|
$tutorial: |
|
|
$id: |
|
|
$category: |
|
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
Generate the constants.xml, packagename.xml, and globals.xml files
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
void ProgramExample(
$listing, [
$tutorial = false], [
$inlinesourceparse = null], [
$class = null], [
$linenum = null], [
$filesourcepath = null], [
$origsource = null]
)
|
|
Parameters:
|
$listing: |
|
|
$tutorial: |
|
|
$inlinesourceparse: |
|
|
$class: |
|
|
$linenum: |
|
|
$filesourcepath: |
|
|
$origsource: |
|
Redefinition of:
- Converter::ProgramExample()
- Used to convert the <code> tag in a docblock
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 <link> tag |
Redefinition of:
- Converter::returnSee()
- take abstractLink descendant and text $eltext and return a link
void setTemplateDir(
$dir
)
|
|
Parameters:
Redefinition of:
- Converter::setTemplateDir()
- sets the template directory based on the $outputformat and $name
void writeExample(
$title,
$path,
$source
)
|
|
Parameters:
Redefinition of:
- Converter::writeExample()
- Write out the formatted source code for an example php file
void writeFile(
string
$file, string
$data, [boolean
$binary = false]
)
|
|
Writes a file to target dir, beautify any .xml files first
Parameters:
string |
$file: |
filename |
string |
$data: |
file contents |
boolean |
$binary: |
true if the data is binary and not text |
Redefinition of:
- Converter::writeFile()
- Writes a file to target dir
void writeNewPPage(
$key
)
|
|
Does nothing
Parameters:
|
|