uw Sun Feb 18 08:53:01 2001 EDT
Modified files:
/php4/pear/PHPDoc/xmlexporter PhpdocXMLClassExporter.php
PhpdocXMLDocumentExporter.php
PhpdocXMLExporter.php
PhpdocXMLIndexExporter.php
PhpdocXMLModuleExporter.php
PhpdocXMLWarningExporter.php
Log:
Sorry, whitespace only changes to follow the PEAR Coding conventions. Replaced tabs
with spaces.
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2
php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.3
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2 Sun Dec 3 14:37:38
2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php Sun Feb 18 08:53:00
+2001
@@ -2,180 +2,182 @@
/**
* Exports the data of a class as an xml file.
*
-* @version $Id: PhpdocXMLClassExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $
+* @version $Id: PhpdocXMLClassExporter.php,v 1.3 2001/02/18 16:53:00 uw Exp $
*/
class PhpdocXMLClassExporter extends PhpdocXMLDocumentExporter {
- /**
- * Variable container attributes.
- * @var array $variableAttributes
- */
- var $variableAttributes = array(
-
"name" => "CDATA",
-
"access" => "CDATA",
-
"type" => "CDATA",
-
"abstract" => "Boolean",
-
"static" => "Boolean",
-
"final" => "Boolean"
-
);
- /**
- * Class container attributes.
- * @var array $classAttributes
- */
- var $classAttributes = array(
-
"name" => "CDATA",
-
"extends" => "CDATA",
-
"undoc" => "Boolean",
-
"access" => "CDATA",
-
"abstract" => "Boolean",
-
"static" => "Boolean",
-
"final" => "Boolean",
-
"package" => "CDATA"
-
);
+ /**
+ * Variable container attributes.
+ *
+ * @var array $variableAttributes
+ */
+ var $variableAttributes = array(
+ "name" => "CDATA",
+ "access" => "CDATA",
+ "type" => "CDATA",
+ "abstract" => "Boolean",
+ "static" => "Boolean",
+ "final" => "Boolean"
+ );
+ /**
+ * Class container attributes.
+ *
+ * @var array $classAttributes
+ */
+ var $classAttributes = array(
+ "name" => "CDATA",
+ "extends" => "CDATA",
+ "undoc" => "Boolean",
+ "access" => "CDATA",
+ "abstract" => "Boolean",
+ "static" => "Boolean",
+ "final" => "Boolean",
+ "package" => "CDATA"
+ );
- var $fileprefix = "class_";
-
- function PhpdocXMLClassExporter() {
- $this->PHPDocXMLExporter();
- } // end constructor
-
- function create() {
-
- $attribs = $this->getAttributes($this->result,
$this->classAttributes);
- $this->xmlwriter->startElement("class", "", $attribs, false);
-
- $this->filenameXML($this->result["filename"]);
-
- $this->docXML($this->result);
-
- if (isset($this->result["functions"]))
- $this->functionsXML($this->result["functions"]);
-
- if (isset($this->result["variables"]))
- $this->variablesXML($this->result["variables"]);
-
- if (isset($this->result["uses"]))
- $this->usesXML($this->result["uses"]);
-
- if (isset($this->result["consts"]))
- $this->constsXML($this->result["consts"]);
-
- if (isset($this->result["inherited"]))
- $this->inheritedOverridenXML($this->result["inherited"],
"inherited");
-
- if (isset($this->result["overriden"]))
- $this->inheritedOverridenXML($this->result["overriden"],
"overriden");
-
- if (isset($this->result["path"]))
- $this->pathXML($this->result["path"]);
-
- if (isset($this->result["baseclass"]))
- $this->baseclassXML($this->result["baseclass"]);
-
- if (isset($this->result["subclasses"]))
- $this->subclassesXML($this->result["subclasses"]);
-
- $this->xmlwriter->endElement("class", true);
-
- } // end func create
-
- /**
- * Handles inherited and overriden elements.
- *
- * @param array Array of inherited or overriden elements
- * @param string Container used when saving the elements
- */
- function inheritedOverridenXML($data, $tag) {
-
- reset($data);
- while (list($type, $elements) = each($data)) {
-
- reset($elements);
- while (list($from, $data2) = each($elements)) {
+ var $fileprefix = "class_";
+
+ function PhpdocXMLClassExporter() {
+ $this->PHPDocXMLExporter();
+ } // end constructor
+
+ function create() {
+
+ $attribs = $this->getAttributes($this->result, $this->classAttributes);
+
+ $this->xmlwriter->startElement("class", "", $attribs, false);
+
+ $this->filenameXML($this->result["filename"]);
+
+ $this->docXML($this->result);
+
+ if (isset($this->result["functions"]))
+ $this->functionsXML($this->result["functions"]);
+
+ if (isset($this->result["variables"]))
+ $this->variablesXML($this->result["variables"]);
+
+ if (isset($this->result["uses"]))
+ $this->usesXML($this->result["uses"]);
+
+ if (isset($this->result["consts"]))
+ $this->constsXML($this->result["consts"]);
+
+ if (isset($this->result["inherited"]))
+ $this->inheritedOverridenXML($this->result["inherited"], "inherited");
+
+ if (isset($this->result["overriden"]))
+ $this->inheritedOverridenXML($this->result["overriden"], "overriden");
+
+ if (isset($this->result["path"]))
+ $this->pathXML($this->result["path"]);
+
+ if (isset($this->result["baseclass"]))
+ $this->baseclassXML($this->result["baseclass"]);
+
+ if (isset($this->result["subclasses"]))
+ $this->subclassesXML($this->result["subclasses"]);
+
+ $this->xmlwriter->endElement("class", true);
+
+ } // end func create
+
+ /**
+ * Handles inherited and overriden elements.
+ *
+ * @param array Array of inherited or overriden elements
+ * @param string Container used when saving the elements
+ */
+ function inheritedOverridenXML($data, $tag) {
+
+ reset($data);
+ while (list($type, $elements) = each($data)) {
+
+ reset($elements);
+ while (list($from, $data2) = each($elements)) {
- $attribs = $this->getAttributes( array ("type" =>
$type, "src" => $from), $this->inheritedOverridenAttributes);
- $this->xmlwriter->startElement($tag, "", $attribs,
false);
-
- reset($data2);
- while (list($name, $v) = each($data2))
- $this->xmlwriter->addElement("element", $name);
-
- $this->xmlwriter->endElement($tag, true);
-
- }
-
- }
-
- } // end func inheritedOverridenXML
+ $attribs = $this->getAttributes( array ("type" => $type, "src" =>
+$from), $this->inheritedOverridenAttributes);
+ $this->xmlwriter->startElement($tag, "", $attribs, false);
+
+ reset($data2);
+ while (list($name, $v) = each($data2))
+ $this->xmlwriter->addElement("element", $name);
+
+ $this->xmlwriter->endElement($tag, true);
+
+ }
+
+ }
+
+ } // end func inheritedOverridenXML
- /**
- * Writes the "path" (inheritance chain) of an element.
- *
- * @param array
- */
- function pathXML($path) {
- if (0 == count($path))
- return;
-
- $this->xmlwriter->startElement("path", "", "", false);
-
- reset($path);
- while (list($k, $parent) = each($path))
- $this->xmlwriter->addElement("parent", $parent);
-
- $this->xmlwriter->endElement("path", true);
-
- } // end func pathXML
-
- /**
- * Adds a baseclass container to the generated xml.
- *
- * @param string Name of the baseclass
- */
- function baseclassXML($base) {
-
- if ("" != $base)
- $this->xmlwriter->addElement("baseclass", $base);
-
- } // end func baseclassXML
-
- /**
- * Adds a list of subclasses to the generated xml.
- *
- * @param array
- */
- function subclassesXML($subclasses) {
- if (0 == count($subclasses))
- return;
-
- $this->xmlwriter->startElement("subclasses", "", "", false, true);
-
- reset($subclasses);
- while(list($subclass, $v) = each($subclasses))
- $this->xmlwriter->addElement("subclass", $subclass);
-
- $this->xmlwriter->endElement("subclasses", true);
-
- } // end func subclassesXML
-
- /**
- * Adds class variables to the XMl document.
- *
- * @param array
- */
- function variablesXML($variables) {
-
- reset($variables);
- while (list($variable, $data) = each($variables)) {
-
- $attribs = $this->getAttributes($data,
$this->variableAttributes);
- $this->xmlwriter->startElement("variable", $data["value"],
$attribs, false);
- $this->docXML($data);
- $this->xmlwriter->endElement("variable", true);
-
- }
-
- } // end func variablesXML
-
+ /**
+ * Writes the "path" (inheritance chain) of an element.
+ *
+ * @param array
+ */
+ function pathXML($path) {
+ if (0 == count($path))
+ return;
+
+ $this->xmlwriter->startElement("path", "", "", false);
+
+ reset($path);
+ while (list($k, $parent) = each($path))
+ $this->xmlwriter->addElement("parent", $parent);
+
+ $this->xmlwriter->endElement("path", true);
+
+ } // end func pathXML
+
+ /**
+ * Adds a baseclass container to the generated xml.
+ *
+ * @param string Name of the baseclass
+ */
+ function baseclassXML($base) {
+
+ if ("" != $base)
+ $this->xmlwriter->addElement("baseclass", $base);
+
+ } // end func baseclassXML
+
+ /**
+ * Adds a list of subclasses to the generated xml.
+ *
+ * @param array
+ */
+ function subclassesXML($subclasses) {
+ if (0 == count($subclasses))
+ return;
+
+ $this->xmlwriter->startElement("subclasses", "", "", false, true);
+
+ reset($subclasses);
+ while(list($subclass, $v) = each($subclasses))
+ $this->xmlwriter->addElement("subclass", $subclass);
+
+ $this->xmlwriter->endElement("subclasses", true);
+
+ } // end func subclassesXML
+
+ /**
+ * Adds class variables to the XMl document.
+ *
+ * @param array
+ */
+ function variablesXML($variables) {
+
+ reset($variables);
+ while (list($variable, $data) = each($variables)) {
+
+ $attribs = $this->getAttributes($data, $this->variableAttributes);
+ $this->xmlwriter->startElement("variable", $data["value"], $attribs,
+false);
+ $this->docXML($data);
+ $this->xmlwriter->endElement("variable", true);
+
+ }
+
+ } // end func variablesXML
+
} // end class PhpdocXMLClassExporter
?>
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.2
php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.3
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.2 Sun Dec 3
14:37:38 2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php Sun Feb 18 08:53:00
+2001
@@ -2,419 +2,419 @@
/**
* Base of the class and module exporter.
*
-* @version $Id: PhpdocXMLDocumentExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $
+* @version $Id: PhpdocXMLDocumentExporter.php,v 1.3 2001/02/18 16:53:00 uw Exp $
*/
class PhpdocXMLDocumentExporter extends PhpdocXMLExporter {
-
- /**
- * Mapping from internal result array index name to xml tag name.
- *
- * @var array $docTags
- */
- var $docTags = array(
-
"desc" => "description",
-
"sdesc" => "shortdescription",
-
-
"version" => "version",
-
"since" => "since",
-
"version" => "version",
-
"deprec" => "deprecated",
-
"copyright" => "copyright",
-
"exclude" => "exclude",
-
"brother" => "brother",
-
"magic" => "magic"
-
);
-
- /**
- * Attributes of the <see> container.
- *
- * @var array $seeAttributes
- */
- var $seeAttributes = array(
-
"type" => "CDATA",
-
"group" => "CDATA"
-
);
-
- /**
- * Attributes of the <link> container.
- *
- * @var array $linkAttributes
- */
- var $linkAttributes = array( "url" => "CDATA" );
-
- /**
- * Attributes of the <author> container.
- *
- * @var array $authorAttributes
- */
- var $authorAttributes = array( "email" => "CDATA" );
-
- /**
- * Attributes of <inherited> and <overriden> container.
- *
- * @var array $inheritedOverridenAttributes
- */
- var $inheritedOverridenAttributes = array(
-
"src" =>
"CDATA",
-
"type" => "CDATA"
-
);
-
- /**
- * Attributes of the <constant> container.
- *
- * @var array $constAttributes
- */
- var $constAttributes = array(
-
"name" => "CDATA",
-
"undoc" => "Boolean",
-
"access" => "CDATA",
-
"case" => "CDATA"
-
);
-
- /**
- * Attribues of the <uses> container.
- *
- * @var array $usesAttributes
- */
- var $usesAttributes = array(
-
"type" => "CDATA",
-
"file" => "CDATA",
-
"undoc" => "Boolean"
-
);
-
- /**
- * Attribues of the <function> container.
- *
- * @var array $functionAttributes
- */
- var $functionAttributes = array(
-
"name" => "CDATA",
-
"undoc" => "Boolean",
-
"access" => "CDATA",
-
"abstract" => "Boolean",
-
"static" => "CDATA"
-
);
-
- /**
- * Attributes of the <return> container.
- *
- * @var array $returnAttributes
- */
- var $returnAttributes = array(
-
"name" => "CDATA",
-
"type" => "CDATA"
-
);
-
- /**
- * Attributes of the <global> container.
- *
- * @var array $globalAttributes
- */
- var $globalAttributes = array(
-
"name" => "CDATA",
-
"type" => "CDATA"
-
);
-
- /**
- * Attributes of the <param> container.
- *
- * @var array $paramAttributes
- */
- var $paramAttributes = array(
-
"name" => "CDATA",
-
"default" => "CDATA",
-
"type" => "CDATA",
-
"undoc" => "Boolean"
-
);
-
- /**
- * Writes a <file> container.
- *
- * @param string $file filename
- */
- function filenameXML($file) {
- $this->xmlwriter->addElement("file", $file);
- } // end func filenameXML
-
- /**
- * Adds all constants (define(), const) to the xml document.
- *
- * @param array Array of constants
- * @return boolean Returns false on failure otherwise true
- */
- function constsXML($consts) {
- if (!is_array($consts) || 0 == count($consts))
- return true;
-
- reset($consts);
- while (list($k, $data)=each($consts)) {
-
- $attribs = $this->getAttributes($data, $this->constAttributes);
- $this->xmlwriter->startElement("constant",
(isset($data["value"])) ? $data["value"] : "", $attribs, false, true);
- $this->docXML($data);
- $this->xmlwriter->endElement("constant", true);
-
- }
-
- return true;
- } // end func constsXML
-
- /**
- * Adds a list of used files (include, require...) to the xml document.
- *
- * @param array
- */
- function usesXML($uses) {
- if (!is_array($uses)) {
- $this->err[] = new PhpdocError("No array given.", __FILE__,
__LINE__);
- return false;
- }
-
- reset($uses);
- while (list($k, $data) = each($uses)) {
-
- $attribs = $this->getAttributes($data, $this->usesAttributes);
- $this->xmlwriter->startElement("uses", "", $attribs, false,
true);
- $this->docXML($data);
- $this->xmlwriter->endElement("uses", true);
-
- }
-
- return true;
- } // end func usesXML
-
- /**
- * Adds a list of functions to the xml file.
- *
- * @param array
- */
- function functionsXML($functions) {
- if (!is_array($functions)) {
- $this->err[] = new PhpdocError("No array given.", __FILE__,
__LINE__);
- return false;
- }
-
- reset($functions);
- while (list($k, $data) = each($functions)) {
-
- $attribs = $this->getAttributes($data,
$this->functionAttributes);
- $this->xmlwriter->startElement("function", "", $attribs,
false, true);
- $this->docXML($data);
- $this->xmlwriter->endElement("function", true);
-
- }
-
- } // end functionsXML
-
- /**
- * Adds a documentation block (author, links, see, params...) to the xml
document
- *
- * @param array
- */
- function docXML($data) {
-
- $this->xmlwriter->startElement("doc", "", "", false, true);
-
- if (isset($data["link"]))
- $this->linkXML($data["link"]);
-
- if (isset($data["author"]))
- $this->authorXML($data["author"]);
-
- if (isset($data["see"]))
- $this->seeXML($data["see"]);
-
- if (isset($data["params"]))
- $this->paramsXML($data["params"]);
-
- if (isset($data["return"]))
- $this->returnXML($data["return"]);
-
- if (isset($data["throws"]))
- $this->throwsXML($data["throws"]);
-
- if (isset($data["global"]))
- $this->globalsXML($data["global"]);
-
- if (isset($data["inherited"])) {
-
-
- $attribs = array(
-
"src" => array(
-
"type" => $this->inheritedOverridenAttributes["src"],
-
"value" => $data["inherited"]
-
)
-
);
- $this->xmlwriter->addElement("inherited", "", $attribs);
- }
-
- if (isset($data["overrides"])) {
- $attribs = array(
-
"src" => array(
-
"type" => $this->inheritedOverridenAttributes["src"],
-
"value" => $data["overrides"]
-
)
-
);
- $this->xmlwriter->addElement("overriden", "", $attribs);
- }
-
- reset($this->docTags);
- while (list($field, $tag) = each($this->docTags))
- if (isset($data[$field]))
- $this->xmlwriter->addElement($tag, $data[$field], "");
-
- $this->xmlwriter->endElement("doc", true);
- } // end func docXML
-
- /**
- * Adds <global> container to the xml document.
- *
- * @param array
- */
- function globalsXML($globals) {
-
- reset($globals);
- while (list($k, $data) = each($globals)) {
- $attribs = $this->getAttributes($data,
$this->globalAttributes);
- $this->xmlwriter->addElement("global", (isset($data["desc"]))
? $data["desc"] : "", $attribs);
- }
-
- } // end func globalsXML
-
- /**
- * Adds <throws> container to the xml document.
- *
- * @param array
- */
- function throwsXML($exceptions) {
-
- reset($exceptions);
- while (list($k, $exception) = each($exceptions))
- $this->xmlwriter->addElement("throws", $exception, "", true);
-
- } // end func throwsXML
-
- /**
- * Adds <return> container to the xml document.
- *
- * @param array
- */
- function returnXML($return) {
-
- $desc = "";
-
- if (is_array($return)) {
-
- if (isset($return["desc"])) {
- $desc = $return["desc"];
- unset($return["desc"]);
- }
- $attribs = $this->getAttributes($return,
$this->returnAttributes);
-
- } else {
-
- $attribs["type"] = array( "type" => "CDATA", "value"
=> $return );
-
- }
-
- $this->xmlwriter->addElement("return", $desc, $attribs);
-
- } // end func returnXML
-
- /**
- * Adds <parameter> container to the xml document.
- *
- * @param array
- */
- function paramsXML($params) {
-
- reset($params);
- while (list($k, $data) = each($params)) {
- $attribs = $this->getAttributes($data, $this->paramAttributes);
- $this->xmlwriter->addElement("parameter",
(isset($data["desc"])) ? $data["desc"] : "", $attribs);
- }
-
- } // end func paramsXML
-
- /**
- * Adds <author> container to the xml document.
- *
- * @param array
- */
- function authorXML($authors) {
-
- reset($authors);
- while (list($k, $data) = each($authors)) {
-
- $attribs = array();
-
- if (isset($data["mail"]))
- $attribs = array(
-
"email" => array(
-
"type" => $this->authorAttributes["email"],
-
"value" => $data["mail"]
-
)
-
);
- $this->xmlwriter->addElement("author",$data["name"], $attribs);
-
- }
-
- } // end func authorXML
-
- /**
- * Adds <link> container to the xml document.
- *
- * @param array
- */
- function linkXML($links) {
-
- reset($links);
- while (list($k, $data) = each($links)) {
-
- $attribs = array(
-
"url" => array(
-
"type" => $this->linkAttributes["url"],
-
"value" => $data["url"]
-
)
-
);
- $this->xmlwriter->addElement("link", (isset($data["desc"])) ?
$data["desc"] : "", $attribs);
-
- }
-
- } // end func linkXML
-
- /**
- * Adds <see> container to the xml document.
- *
- * @param array
- */
- function seeXML($see) {
-
- reset($see);
- while (list($type, $data) = each($see)) {
-
- reset($data);
- while (list($k, $data2) = each($data)) {
-
- $attribs = array(
-
"type" => array(
-
"type" => $this->seeAttributes["type"],
-
"value" => strtolower($type)
-
)
-
);
- if (isset($data2["group"]))
- $attribs["group"] = array(
-
"type" =>
$this->seeAttributes["group"],
-
"value" => $data2["group"]
-
);
-
- $this->xmlwriter->addElement("see", $data2["name"],
$attribs);
-
- }
-
- }
-
- } // end func SeeXML
+
+ /**
+ * Mapping from internal result array index name to xml tag name.
+ *
+ * @var array $docTags
+ */
+ var $docTags = array(
+ "desc" => "description",
+ "sdesc" => "shortdescription",
+
+ "version" => "version",
+ "since" => "since",
+ "version" => "version",
+ "deprec" => "deprecated",
+ "copyright" => "copyright",
+ "exclude" => "exclude",
+ "brother" => "brother",
+ "magic" => "magic"
+ );
+
+ /**
+ * Attributes of the <see> container.
+ *
+ * @var array
+ */
+ var $seeAttributes = array(
+ "type" => "CDATA",
+ "group" => "CDATA"
+ );
+
+ /**
+ * Attributes of the <link> container.
+ *
+ * @var array
+ */
+ var $linkAttributes = array( "url" => "CDATA" );
+
+ /**
+ * Attributes of the <author> container.
+ *
+ * @var array
+ */
+ var $authorAttributes = array( "email" => "CDATA" );
+
+ /**
+ * Attributes of <inherited> and <overriden> container.
+ *
+ * @var array
+ */
+ var $inheritedOverridenAttributes = array(
+ "src" => "CDATA",
+ "type" => "CDATA"
+ );
+
+ /**
+ * Attributes of the <constant> container.
+ *
+ * @var array
+ */
+ var $constAttributes = array(
+ "name" => "CDATA",
+ "undoc" => "Boolean",
+ "access" => "CDATA",
+ "case" => "CDATA"
+ );
+
+ /**
+ * Attribues of the <uses> container.
+ *
+ * @var array
+ */
+ var $usesAttributes = array(
+ "type" => "CDATA",
+ "file" => "CDATA",
+ "undoc" => "Boolean"
+ );
+
+ /**
+ * Attribues of the <function> container.
+ *
+ * @var array
+ */
+ var $functionAttributes = array(
+ "name" => "CDATA",
+ "undoc" => "Boolean",
+ "access" => "CDATA",
+ "abstract" => "Boolean",
+ "static" => "CDATA"
+ );
+
+ /**
+ * Attributes of the <return> container.
+ *
+ * @var array
+ */
+ var $returnAttributes = array(
+ "name" => "CDATA",
+ "type" => "CDATA"
+ );
+
+ /**
+ * Attributes of the <global> container.
+ *
+ * @var array
+ */
+ var $globalAttributes = array(
+ "name" => "CDATA",
+ "type" => "CDATA"
+ );
+
+ /**
+ * Attributes of the <param> container.
+ *
+ * @var array
+ */
+ var $paramAttributes = array(
+ "name" => "CDATA",
+ "default" => "CDATA",
+ "type" => "CDATA",
+ "undoc" => "Boolean"
+ );
+
+ /**
+ * Writes a <file> container.
+ *
+ * @param string $file Filename
+ */
+ function filenameXML($file) {
+ $this->xmlwriter->addElement("file", $file);
+ } // end func filenameXML
+
+ /**
+ * Adds all constants (define(), const) to the xml document.
+ *
+ * @param array Array of constants
+ * @return boolean Returns false on failure otherwise true
+ */
+ function constsXML($consts) {
+ if (!is_array($consts) || 0 == count($consts))
+ return true;
+
+ reset($consts);
+ while (list($k, $data)=each($consts)) {
+
+ $attribs = $this->getAttributes($data, $this->constAttributes);
+ $this->xmlwriter->startElement("constant", (isset($data["value"])) ?
+$data["value"] : "", $attribs, false, true);
+ $this->docXML($data);
+ $this->xmlwriter->endElement("constant", true);
+
+ }
+
+ return true;
+ } // end func constsXML
+
+ /**
+ * Adds a list of used files (include, require...) to the xml document.
+ *
+ * @param array
+ */
+ function usesXML($uses) {
+ if (!is_array($uses)) {
+ $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__);
+ return false;
+ }
+
+ reset($uses);
+ while (list($k, $data) = each($uses)) {
+
+ $attribs = $this->getAttributes($data, $this->usesAttributes);
+ $this->xmlwriter->startElement("uses", "", $attribs, false, true);
+ $this->docXML($data);
+ $this->xmlwriter->endElement("uses", true);
+
+ }
+
+ return true;
+ } // end func usesXML
+
+ /**
+ * Adds a list of functions to the xml file.
+ *
+ * @param array
+ */
+ function functionsXML($functions) {
+ if (!is_array($functions)) {
+ $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__);
+ return false;
+ }
+
+ reset($functions);
+ while (list($k, $data) = each($functions)) {
+
+ $attribs = $this->getAttributes($data, $this->functionAttributes);
+
+ $this->xmlwriter->startElement("function", "", $attribs, false, true);
+ $this->docXML($data);
+ $this->xmlwriter->endElement("function", true);
+
+ }
+
+ } // end functionsXML
+
+ /**
+ * Adds a documentation block (author, links, see, params...) to the xml document
+ *
+ * @param sarray
+ */
+ function docXML($data) {
+
+ $this->xmlwriter->startElement("doc", "", "", false, true);
+
+ if (isset($data["link"]))
+ $this->linkXML($data["link"]);
+
+ if (isset($data["author"]))
+ $this->authorXML($data["author"]);
+
+ if (isset($data["see"]))
+ $this->seeXML($data["see"]);
+
+ if (isset($data["params"]))
+ $this->paramsXML($data["params"]);
+
+ if (isset($data["return"]))
+ $this->returnXML($data["return"]);
+
+ if (isset($data["throws"]))
+ $this->throwsXML($data["throws"]);
+
+ if (isset($data["global"]))
+ $this->globalsXML($data["global"]);
+
+ if (isset($data["inherited"])) {
+
+
+ $attribs = array(
+ "src" => array(
+ "type" =>
+$this->inheritedOverridenAttributes["src"],
+ "value" => $data["inherited"]
+ )
+ );
+ $this->xmlwriter->addElement("inherited", "", $attribs);
+ }
+
+ if (isset($data["overrides"])) {
+ $attribs = array(
+ "src" => array(
+ "type" =>
+$this->inheritedOverridenAttributes["src"],
+ "value" => $data["overrides"]
+ )
+ );
+ $this->xmlwriter->addElement("overriden", "", $attribs);
+
+ }
+
+ reset($this->docTags);
+ while (list($field, $tag) = each($this->docTags))
+ if (isset($data[$field]))
+ $this->xmlwriter->addElement($tag, $data[$field], "");
+
+ $this->xmlwriter->endElement("doc", true);
+ } // end func docXML
+
+ /**
+ * Adds <global> container to the xml document.
+ *
+ * @param array
+ */
+ function globalsXML($globals) {
+
+ reset($globals);
+ while (list($k, $data) = each($globals)) {
+ $attribs = $this->getAttributes($data, $this->globalAttributes);
+ $this->xmlwriter->addElement("global", (isset($data["desc"])) ?
+$data["desc"] : "", $attribs);
+ }
+
+ } // end func globalsXML
+
+ /**
+ * Adds <throws> container to the xml document.
+ *
+ * @param array
+ */
+ function throwsXML($exceptions) {
+
+ reset($exceptions);
+ while (list($k, $exception) = each($exceptions))
+ $this->xmlwriter->addElement("throws", $exception, "", true);
+
+ } // end func throwsXML
+
+ /**
+ * Adds <return> container to the xml document.
+ *
+ * @param array
+ */
+ function returnXML($return) {
+
+ $desc = "";
+
+ if (is_array($return)) {
+
+ if (isset($return["desc"])) {
+ $desc = $return["desc"];
+ unset($return["desc"]);
+ }
+ $attribs = $this->getAttributes($return, $this->returnAttributes);
+
+ } else {
+
+ $attribs["type"] = array( "type" => "CDATA", "value" => $return );
+
+ }
+
+ $this->xmlwriter->addElement("return", $desc, $attribs);
+
+ } // end func returnXML
+
+ /**
+ * Adds <parameter> container to the xml document.
+ *
+ * @param array
+ */
+ function paramsXML($params) {
+
+ reset($params);
+ while (list($k, $data) = each($params)) {
+ $attribs = $this->getAttributes($data, $this->paramAttributes);
+ $this->xmlwriter->addElement("parameter", (isset($data["desc"])) ?
+$data["desc"] : "", $attribs);
+ }
+
+ } // end func paramsXML
+
+ /**
+ * Adds <author> container to the xml document.
+ *
+ * @param array
+ */
+ function authorXML($authors) {
+
+ reset($authors);
+ while (list($k, $data) = each($authors)) {
+
+ $attribs = array();
+
+ if (isset($data["mail"]))
+ $attribs = array(
+ "email" => array(
+ "type" =>
+$this->authorAttributes["email"],
+ "value" => $data["mail"]
+ )
+ );
+ $this->xmlwriter->addElement("author",$data["name"], $attribs);
+
+ }
+
+ } // end func authorXML
+
+ /**
+ * Adds <link> container to the xml document.
+ *
+ * @param array
+ */
+ function linkXML($links) {
+
+ reset($links);
+ while (list($k, $data) = each($links)) {
+
+ $attribs = array(
+ "url" => array(
+ "type" =>
+$this->linkAttributes["url"],
+ "value" => $data["url"]
+ )
+ );
+ $this->xmlwriter->addElement("link", (isset($data["desc"])) ?
+$data["desc"] : "", $attribs);
+
+ }
+
+ } // end func linkXML
+
+ /**
+ * Adds <see> container to the xml document.
+ *
+ * @param array
+ */
+ function seeXML($see) {
+
+ reset($see);
+ while (list($type, $data) = each($see)) {
+
+ reset($data);
+ while (list($k, $data2) = each($data)) {
+
+ $attribs = array(
+ "type" => array(
+ "type" =>
+$this->seeAttributes["type"],
+ "value" => strtolower($type)
+ )
+ );
+ if (isset($data2["group"]))
+ $attribs["group"] = array(
+ "type" =>
+$this->seeAttributes["group"],
+ "value" => $data2["group"]
+ );
+
+ $this->xmlwriter->addElement("see", $data2["name"], $attribs);
+
+ }
+
+ }
+
+ } // end func SeeXML
} // end class PhpdocXMLDocumentExporter
?>
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.2
php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.3
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.2 Sun Dec 3 14:37:38
2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php Sun Feb 18 08:53:00 2001
@@ -2,141 +2,144 @@
/**
* Exporter used to export phpdoc internals data structures as xml documents.
*
-* @version $Id: PhpdocXMLExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $
+* @version $Id: PhpdocXMLExporter.php,v 1.3 2001/02/18 16:53:00 uw Exp $
*/
class PhpdocXMLExporter extends PhpdocObject {
-
- /**
- * Filename prefix for the generated xml document.
- *
- * This class variable must be overriden by all derived classes.
- * PHPDoc uses the filename prefix to detect the content of
- * the file.
- *
- * @var string $fileprefix
- */
- var $fileprefix = "";
+
+ /**
+ * Filename prefix for the generated xml document.
+ *
+ * This class variable must be overriden by all derived classes.
+ * PHPDoc uses the filename prefix to detect the content of
+ * the file.
+ *
+ * @var string $fileprefix
+ */
+ var $fileprefix = "";
- /**
- * Target directory where the xml documents get saved.
- * @var string $path
- * @see setPath()
- */
- var $path = "";
-
- /**
- * Data to save as a xml document.
- * @var array $result
- * @see setResult(), export()
- */
- var $result = array();
-
- /**
- * Instance of PhpdocXMLWriter used to generate the xml document.
- * @var object PhpdocXMLWriter
- * @see PhpdocXMLExporter()
- */
- var $xmlwriter;
-
- /**
- * Creates a PhpdocXMLWriter object.
- *
- * Make sure that all derived classes call this constructor.
- *
- * @see $xmlwriter
- */
- function PhpdocXMLExporter() {
-
- $this->xmlwriter = new PhpdocXMLWriter;
-
- } // end constructor
+ /**
+ * Target directory where the xml documents get saved.
+ *
+ * @var string $path
+ * @see setPath()
+ */
+ var $path = "";
+
+ /**
+ * Data to save as a xml document.
+ *
+ * @var array $result
+ * @see setResult(), export()
+ */
+ var $result = array();
+
+ /**
+ * Instance of PhpdocXMLWriter used to generate the xml document.
+ *
+ * @var object PhpdocXMLWriter
+ * @see PhpdocXMLExporter()
+ */
+ var $xmlwriter;
+
+ /**
+ * Creates a PhpdocXMLWriter object.
+ *
+ * Make sure that all derived classes call this constructor.
+ *
+ * @see $xmlwriter
+ */
+ function PhpdocXMLExporter() {
+
+ $this->xmlwriter = new PhpdocXMLWriter;
+
+ } // end constructor
- /**
- * Sets the target path for the generated xml documents.
- *
- * @param string
- * @see $path
- * @access public
- */
- function setPath($path) {
- $this->path = $path;
- } // end func setPath
-
- /**
- * Exports the given result array as xml document.
- *
- * @param array
- * @param string name of the target xml file
- * @access public
- * @see create(), $result
- */
- function export($result, $xmlfile="") {
-
- if (0 == count($result))
- return;
+ /**
+ * Sets the target path for the generated xml documents.
+ *
+ * @param string
+ * @see $path
+ * @access public
+ */
+ function setPath($path) {
+ $this->path = $path;
+ } // end func setPath
+
+ /**
+ * Exports the given result array as xml document.
+ *
+ * @param array
+ * @param string name of the target xml file
+ * @access public
+ * @see create(), $result
+ */
+ function export($result, $xmlfile="") {
+
+ if (0 == count($result))
+ return;
- $this->result = $result;
-
- $this->xmlwriter->addXML('<?xml version="1.0"?>');
- $this->xmlwriter->startElement("phpdoc", "", "", false, true);
+ $this->result = $result;
+
+ $this->xmlwriter->addXML('<?xml version="1.0"?>');
+ $this->xmlwriter->startElement("phpdoc", "", "", false, true);
- $this->create();
+ $this->create();
- $this->xmlwriter->endElement("phpdoc", true);
-
- if ("" == $xmlfile)
- $xmlfile = $this->result["name"];
-
- /*
- if (file_exists($this->path.$xmlfile)) {
- $i = 1;
- while (file_exists($this->path.$name."_".$i.".xml"))
- $i++;
-
- $xmlfile = $name."_".$i.".xml";
- }
- */
-
- $xmlfile = $this->nameToURL($xmlfile);
- $xmlfile = $this->path.$this->fileprefix.$xmlfile.".xml";
-
- $this->xmlwriter->export($xmlfile);
- $this->xmlwriter->free();
-
- } // end func export
-
- /**
- * @param array
- */
- function setResult($result) {
- $this->result = $result;
- $this->create();
- } // end func setResult
-
- /**
- * Kind of array_intersect for xml attributes.
- *
- * This functions takes a data array and a list of allowed fields in the data
- * array. All of the allowed fields that exists in the data array will be
- * copied to returned array which looks like:
- * $attribs[name] = array ( type => allowed[name], value => data[name] ).
- * This structure is used by PhpdocXMLWriter->addElement().
- *
- * @param array data array
- * @param array array of allowed fields and their attribute type
- * @return array $attribs
- */
- function getAttributes($data, $allowed) {
-
- $attribs = array();
-
- reset($allowed);
- while (list($tag, $type)=each($allowed))
- if (isset($data[$tag]))
- $attribs[$tag] = array( "type" => $type, "value" =>
$data[$tag] );
-
- return $attribs;
- } // end func getAttributes
+ $this->xmlwriter->endElement("phpdoc", true);
+
+ if ("" == $xmlfile)
+ $xmlfile = $this->result["name"];
+
+ /*
+ if (file_exists($this->path.$xmlfile)) {
+ $i = 1;
+ while (file_exists($this->path.$name."_".$i.".xml"))
+ $i++;
+
+ $xmlfile = $name."_".$i.".xml";
+ }
+ */
+
+ $xmlfile = $this->nameToURL($xmlfile);
+ $xmlfile = $this->path . $this->fileprefix . $xmlfile . ".xml";
+
+ $this->xmlwriter->export($xmlfile);
+ $this->xmlwriter->free();
+
+ } // end func export
+
+ /**
+ * @param array
+ */
+ function setResult($result) {
+ $this->result = $result;
+ $this->create();
+ } // end func setResult
+
+ /**
+ * Kind of array_intersect for xml attributes.
+ *
+ * This functions takes a data array and a list of allowed fields in the data
+ * array. All of the allowed fields that exists in the data array will be
+ * copied to returned array which looks like:
+ * $attribs[name] = array ( type => allowed[name], value => data[name] ).
+ * This structure is used by PhpdocXMLWriter->addElement().
+ *
+ * @param array data array
+ * @param array array of allowed fields and their attribute type
+ * @return array $attribs
+ */
+ function getAttributes($data, $allowed) {
+
+ $attribs = array();
+
+ reset($allowed);
+ while (list($tag, $type) = each($allowed))
+ if (isset($data[$tag]))
+ $attribs[$tag] = array( "type" => $type, "value" => $data[$tag] );
+
+ return $attribs;
+ } // end func getAttributes
} // end PhpdocXMLExporter
?>
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.2
php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.3
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.2 Sun Dec 3 14:37:38
2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php Sun Feb 18 08:53:00
+2001
@@ -2,191 +2,191 @@
/**
* Creates XML index files.
*
-* @version $Id: PhpdocXMLIndexExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $
+* @version $Id: PhpdocXMLIndexExporter.php,v 1.3 2001/02/18 16:53:00 uw Exp $
*/
class PhpdocXMLIndexExporter extends PhpdocXMLExporter {
- /**
- * Chapter tag attributes
- *
- * @var array
- */
- var $chapterAttributes = array( "name" => "CDATA" );
-
- /**
- * Element tag attributes.
- *
- * @var array()
- */
- var $elementAttributes = array(
-
"type" => "CDATA",
-
"source" => "CDATA",
-
"sourcetype" => "CDATA"
-
);
- /**
- * Just call the parent class constructor
- */
- function PhpdocXMLIndexExporter() {
- $this->PhpdocXMLExporter();
- } // end constructor
-
- /**
- * Exports a modulegroup.
- *
- * @param array
- * @access public
- */
- function exportModulegroup(&$modulegroup) {
-
- $this->xmlwriter->free();
-
- $this->xmlwriter->addXML('<?xml version="1.0"?>');
- $this->xmlwriter->startElement("phpdoc");
+ /**
+ * Chapter tag attributes
+ *
+ * @var array
+ */
+ var $chapterAttributes = array( "name" => "CDATA" );
+
+ /**
+ * Element tag attributes.
+ *
+ * @var array()
+ */
+ var $elementAttributes = array(
+ "type" => "CDATA",
+ "source" => "CDATA",
+ "sourcetype" => "CDATA"
+ );
+ /**
+ * Just call the parent class constructor
+ */
+ function PhpdocXMLIndexExporter() {
+ $this->PhpdocXMLExporter();
+ } // end constructor
+
+ /**
+ * Exports a modulegroup.
+ *
+ * @param array
+ * @access public
+ */
+ function exportModulegroup(&$modulegroup) {
+
+ $this->xmlwriter->free();
+
+ $this->xmlwriter->addXML('<?xml version="1.0"?>');
+ $this->xmlwriter->startElement("phpdoc");
- reset($modulegroup);
- list($group, $modules) = each($modulegroup);
- $attribs = array( "name" => array( "type" => "CDATA", "value"
=> $group) );
- $this->xmlwriter->startElement("modulegroup", "", $attribs);
-
- reset($modules);
- while (list($k, $module)=each($modules))
- $this->xmlwriter->addElement("module", "", array( "name" =>
array( "type" => "CDATA", "value" => $module )) );
-
- $this->xmlwriter->endElement("modulegroup");
- $this->xmlwriter->endElement("phpdoc");
-
- $group = $this->nameToUrl($group);
- $this->xmlwriter->export($this->path."modulegroup_$group.xml");
- $this->xmlwriter->free();
-
- } // end func exportModulegroup
-
- /**
- * Exports a packagelist
- *
- * @param array
- * @access public
- */
- function exportPackagelist(&$packagelist) {
-
- $this->xmlwriter->free();
-
- $this->xmlwriter->addXML('<?xml version="1.0"?>');
- $this->xmlwriter->startElement("phpdoc");
- $this->xmlwriter->startElement("packagelist");
-
- reset($packagelist);
- while (list($package, $elementlist)=each($packagelist)) {
-
- $attribs = array( "name" => array("type" => "CDATA", "value"
=> $package) );
- $this->xmlwriter->startElement("package", "", $attribs);
-
- reset($elementlist);
- while (list($type, $elements) = each($elementlist)) {
-
- $container = ("classes" == $type) ? "class" : "module";
- while (list($k, $element) = each($elements)) {
-
- $attribs = array( "name" =>
array("type" => "CDATA", "value" => $element));
- $this->xmlwriter->addElement($container, "",
$attribs);
-
- }
-
- }
-
- $this->xmlwriter->endElement("package");
-
- }
-
- $this->xmlwriter->endElement("packagelist");
- $this->xmlwriter->endElement("phpdoc");
- $this->xmlwriter->export($this->path."packagelist.xml");
- $this->xmlwriter->free();
-
- } // end func exportPackagelist
-
- /**
- * Exports a classtree
- *
- * @param array Classtree
- * @param string Name of the baseclass of the classtree
- * @access public
- */
- function exportClasstree(&$classtree, $baseclass) {
-
- $this->xmlwriter->free();
-
- $this->xmlwriter->addXML('<?xml version="1.0"?>');
- $this->xmlwriter->startElement("phpdoc");
-
- $attribs = array("baseclass" => array("type" => "CDATA", "value"
=> $baseclass));
- $this->xmlwriter->startElement("classtree", "", $attribs);
-
- reset($classtree);
- while (list($parentclass, $subclasses) = each($classtree)) {
-
- $attribs = array("name" => array("type" => "CDATA", "value"
=> $parentclass));
- $this->xmlwriter->startElement("class", "", $attribs);
-
- reset($subclasses);
- while (list($subclass, $v) = each($subclasses))
- $this->xmlwriter->addElement("subclass", $subclass);
-
- $this->xmlwriter->endElement("class");
-
- }
-
- $this->xmlwriter->endElement("classtree");
- $this->xmlwriter->endElement("phpdoc");
-
- $baseclass = $this->nameToURL($baseclass);
- $this->xmlwriter->export($this->path . "classtree_$baseclass.xml");
- $this->xmlwriter->free();
-
- } // end func exportClasstree
-
- /**
- * Exports a list of all elements
- *
- * @param array
- * @access public
- */
- function exportElementlist(&$elementlist) {
-
- $this->xmlwriter->free();
-
- $this->xmlwriter->addXML('<?xml version="1.0"?>');
- $this->xmlwriter->startElement("phpdoc");
- $this->xmlwriter->startElement("index");
-
- reset($elementlist);
- while (list($index, $elements) = each($elementlist)) {
-
- $attrib = array( "char" => array( "type" => "CDATA", "value"
=> $index ) );
- $this->xmlwriter->startElement("chapter", "", $attrib);
+ reset($modulegroup);
+ list($group, $modules) = each($modulegroup);
+ $attribs = array( "name" => array( "type" => "CDATA", "value" =>
+$group) );
+ $this->xmlwriter->startElement("modulegroup", "", $attribs);
+
+ reset($modules);
+ while (list($k, $module) = each($modules))
+ $this->xmlwriter->addElement("module", "", array( "name" => array( "type"
+=> "CDATA", "value" => $module )) );
+
+ $this->xmlwriter->endElement("modulegroup");
+ $this->xmlwriter->endElement("phpdoc");
+
+ $group = $this->nameToUrl($group);
+ $this->xmlwriter->export($this->path . "modulegroup_$group.xml");
+ $this->xmlwriter->free();
+
+ } // end func exportModulegroup
+
+ /**
+ * Exports a packagelist
+ *
+ * @param array
+ * @access public
+ */
+ function exportPackagelist(&$packagelist) {
+
+ $this->xmlwriter->free();
+
+ $this->xmlwriter->addXML('<?xml version="1.0"?>');
+ $this->xmlwriter->startElement("phpdoc");
+ $this->xmlwriter->startElement("packagelist");
+
+ reset($packagelist);
+ while (list($package, $elementlist)=each($packagelist)) {
+
+ $attribs = array( "name" => array("type" => "CDATA", "value" => $package)
+);
+ $this->xmlwriter->startElement("package", "", $attribs);
+
+ reset($elementlist);
+ while (list($type, $elements) = each($elementlist)) {
+
+ $container = ("classes" == $type) ? "class" : "module";
+ while (list($k, $element) = each($elements)) {
+
+ $attribs = array( "name" => array("type" => "CDATA", "value" =>
+$element));
+ $this->xmlwriter->addElement($container, "", $attribs);
+
+ }
+
+ }
+
+ $this->xmlwriter->endElement("package");
+
+ }
+
+ $this->xmlwriter->endElement("packagelist");
+ $this->xmlwriter->endElement("phpdoc");
+ $this->xmlwriter->export($this->path."packagelist.xml");
+ $this->xmlwriter->free();
+
+ } // end func exportPackagelist
+
+ /**
+ * Exports a classtree
+ *
+ * @param array Classtree
+ * @param string Name of the baseclass of the classtree
+ * @access public
+ */
+ function exportClasstree(&$classtree, $baseclass) {
+
+ $this->xmlwriter->free();
+
+ $this->xmlwriter->addXML('<?xml version="1.0"?>');
+ $this->xmlwriter->startElement("phpdoc");
+
+ $attribs = array("baseclass" => array("type" => "CDATA", "value" =>
+$baseclass));
+ $this->xmlwriter->startElement("classtree", "", $attribs);
+
+ reset($classtree);
+ while (list($parentclass, $subclasses) = each($classtree)) {
+
+ $attribs = array("name" => array("type" => "CDATA", "value" =>
+$parentclass));
+ $this->xmlwriter->startElement("class", "", $attribs);
+
+ reset($subclasses);
+ while (list($subclass, $v) = each($subclasses))
+ $this->xmlwriter->addElement("subclass", $subclass);
+
+ $this->xmlwriter->endElement("class");
+
+ }
+
+ $this->xmlwriter->endElement("classtree");
+ $this->xmlwriter->endElement("phpdoc");
+
+ $baseclass = $this->nameToURL($baseclass);
+ $this->xmlwriter->export($this->path . "classtree_$baseclass.xml");
+ $this->xmlwriter->free();
+
+ } // end func exportClasstree
+
+ /**
+ * Exports a list of all elements
+ *
+ * @param array
+ * @access public
+ */
+ function exportElementlist(&$elementlist) {
+
+ $this->xmlwriter->free();
+
+ $this->xmlwriter->addXML('<?xml version="1.0"?>');
+ $this->xmlwriter->startElement("phpdoc");
+ $this->xmlwriter->startElement("index");
+
+ reset($elementlist);
+ while (list($index, $elements) = each($elementlist)) {
+
+ $attrib = array( "char" => array( "type" => "CDATA", "value" => $index )
+);
+ $this->xmlwriter->startElement("chapter", "", $attrib);
- reset($elements);
- while (list($name, $element) = each($elements)) {
-
- reset($element);
- while (list($k, $eldata) = each($element)) {
- $attribs = $this->getAttributes($eldata,
$this->elementAttributes);
- $attribs["name"] = array( "type" =>
"CDATA", "value" => $name );
- $this->xmlwriter->addElement("element",
$eldata["sdesc"], $attribs);
- }
-
- }
+ reset($elements);
+ while (list($name, $element) = each($elements)) {
+
+ reset($element);
+ while (list($k, $eldata) = each($element)) {
+ $attribs = $this->getAttributes($eldata,
+$this->elementAttributes);
+ $attribs["name"] = array( "type" => "CDATA", "value" => $name );
+ $this->xmlwriter->addElement("element", $eldata["sdesc"],
+$attribs);
+ }
+
+ }
- $this->xmlwriter->endElement("chapter");
- }
-
- $this->xmlwriter->endElement("index");
- $this->xmlwriter->endElement("phpdoc");
-
- $this->xmlwriter->export($this->path."elementlist.xml");
- $this->xmlwriter->free();
+ $this->xmlwriter->endElement("chapter");
+ }
+
+ $this->xmlwriter->endElement("index");
+ $this->xmlwriter->endElement("phpdoc");
+
+ $this->xmlwriter->export($this->path . "elementlist.xml");
+ $this->xmlwriter->free();
- } // end func exportElementlist
-
+ } // end func exportElementlist
+
} // end class PhpdocXMLIndexExporter
?>
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLModuleExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLModuleExporter.php:1.1
php4/pear/PHPDoc/xmlexporter/PhpdocXMLModuleExporter.php:1.2
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLModuleExporter.php:1.1 Sun Oct 8
03:03:21 2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLModuleExporter.php Sun Feb 18 08:53:00
+2001
@@ -2,50 +2,50 @@
/**
* Exports the data of a module as an xml document
*
-* @author Ulf Wendel <[EMAIL PROTECTED]>
-* @version 1.0
+* @version $Id: PhpdocXMLModuleExporter.php,v 1.2 2001/02/18 16:53:00 uw Exp $
*/
class PhpdocXMLModuleExporter extends PhpdocXMLDocumentExporter {
-
- /**
- * Module container attributes
- * @var array $moduleAttributes
- */
- var $moduleAttributes = array(
-
"name" => "CDATA",
-
"group" => "CDATA",
-
"undoc" => "Boolean",
-
"access" => "CDATA",
-
"package" => "CDATA"
-
);
+
+ /**
+ * Module container attributes
+ *
+ * @var array $moduleAttributes
+ */
+ var $moduleAttributes = array(
+ "name" => "CDATA",
+ "group" => "CDATA",
+ "undoc" => "Boolean",
+ "access" => "CDATA",
+ "package" => "CDATA"
+ );
- var $fileprefix = "module_";
-
- function PhpdocXMLModuleExporter() {
- $this->PhpdocXMLExporter();
- } // end constructor
-
- function create() {
-
- $attribs = $this->getAttributes($this->result,
$this->moduleAttributes);
- $this->xmlwriter->startElement("module", "", $attribs);
-
- $this->filenameXML($this->result["filename"]);
-
- $this->docXML($this->result);
-
- if (isset($this->result["functions"]))
- $this->functionsXML($this->result["functions"]);
-
- if (isset($this->result["uses"]))
- $this->usesXML($this->result["uses"]);
-
- if (isset($this->result["consts"]))
- $this->constsXML($this->result["consts"]);
-
- $this->xmlwriter->endElement("module", true);
-
- } // end func create
-
+ var $fileprefix = "module_";
+
+ function PhpdocXMLModuleExporter() {
+ $this->PhpdocXMLExporter();
+ } // end constructor
+
+ function create() {
+
+ $attribs = $this->getAttributes($this->result, $this->moduleAttributes);
+
+ $this->xmlwriter->startElement("module", "", $attribs);
+
+ $this->filenameXML($this->result["filename"]);
+
+ $this->docXML($this->result);
+
+ if (isset($this->result["functions"]))
+ $this->functionsXML($this->result["functions"]);
+
+ if (isset($this->result["uses"]))
+ $this->usesXML($this->result["uses"]);
+
+ if (isset($this->result["consts"]))
+ $this->constsXML($this->result["consts"]);
+
+ $this->xmlwriter->endElement("module", true);
+
+ } // end func create
+
} // end class PhpdocXMLModuleExporter
?>
Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLWarningExporter.php
diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLWarningExporter.php:1.1
php4/pear/PHPDoc/xmlexporter/PhpdocXMLWarningExporter.php:1.2
--- php4/pear/PHPDoc/xmlexporter/PhpdocXMLWarningExporter.php:1.1 Sun Oct 8
03:03:21 2000
+++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLWarningExporter.php Sun Feb 18 08:53:00
+2001
@@ -4,46 +4,47 @@
*
*/
class PhpdocXMLWarningExporter extends PhpdocXMLExporter {
-
- /**
- * Attributes of a warning container.
- * @var array
- */
- var $warningAttributes = array(
-
"name" =>
"CDATA",
-
"type" =>
"CDATA",
-
"elementtype" => "CDATA"
-
);
-
- var $fileprefix = "warnings_";
-
- function PhpdocXMLWarningExporter() {
- $this->PhpdocXMLExporter();
- } // end constructor
-
- function create() {
+
+ /**
+ * Attributes of a warning container.
+ *
+ * @var array
+ */
+ var $warningAttributes = array(
+ "name" => "CDATA",
+ "type" => "CDATA",
+ "elementtype" => "CDATA"
+ );
+
+ var $fileprefix = "warnings_";
+
+ function PhpdocXMLWarningExporter() {
+ $this->PhpdocXMLExporter();
+ } // end constructor
+
+ function create() {
- reset($this->result);
- while (list($file, $warnings)=each($this->result)) {
-
- $this->xmlwriter->startElement("warnings", "", array("file"
=> array( "type" => "CDATA", "value" => $file)));
-
- reset($warnings);
- while (list($type, $warning)=each($warnings)) {
-
- reset($warning);
- while (list($k, $data)=each($warning)) {
- $data["elementtype"] = $type;
- $this->xmlwriter->addElement("warning",
$data["msg"], $this->getAttributes($data, $this->warningAttributes));
- }
-
- }
-
- $this->xmlwriter->endElement("warnings");
-
- }
-
- } // end function create
-
+ reset($this->result);
+ while (list($file, $warnings) = each($this->result)) {
+
+ $this->xmlwriter->startElement("warnings", "", array("file" => array(
+"type" => "CDATA", "value" => $file)));
+
+ reset($warnings);
+ while (list($type, $warning) = each($warnings)) {
+
+ reset($warning);
+ while (list($k, $data) = each($warning)) {
+ $data["elementtype"] = $type;
+ $this->xmlwriter->addElement("warning", $data["msg"],
+$this->getAttributes($data, $this->warningAttributes));
+ }
+
+ }
+
+ $this->xmlwriter->endElement("warnings");
+
+ }
+
+ } // end function create
+
} // end class PhpdocXMLWarningExporter
?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]