cvs: pear /PHPDoc prepend.php /PHPDoc/accessor PhpdocIndexAccessor.php /PHPDoc/analyser PhpdocAnalyser.php PhpdocClassAnalyser.php /PHPDoc/core
Phpdoc.php PhpdocSetupHandler.php /PHPDoc/parser PhpdocParserCore.php PhpdocParserRegExp.php PhpdocParserTags.php /PHPDoc/renderer/html
PhpdocHTMLClassRenderer.php PhpdocHTMLDocumentRenderer.php PhpdocHTMLIndexRenderer.php /PHPDoc/xmlexporter PhpdocXMLClassExporter.php
/PHPDoc/xmlwriter PhpdocXMLWriter.php
| From: | Ant�nio Carlos Ven�ncio J�nior | Date: | Sat, 17 Aug 2002 23:11:26 +0000 |
| Subject: | cvs: pear /PHPDoc prepend.php /PHPDoc/accessor PhpdocIndexAccessor.php /PHPDoc/analyser PhpdocAnalyser.php PhpdocClassAnalyser.php /PHPDoc/core Phpdoc.php PhpdocSetupHandler.php /PHPDoc/parser PhpdocParserCore.php PhpdocParserRegExp.php PhpdocParserTags.php /PHPDoc/renderer/html PhpdocHTMLClassRenderer.php PhpdocHTMLDocumentRenderer.php PhpdocHTMLIndexRenderer.php /PHPDoc/xmlexporter PhpdocXMLClassExporter.php /PHPDoc/xmlwriter PhpdocXMLWriter.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5790@lists.php.net to get a copy of this message | ||
floripa Sat Aug 17 19:11:26 2002 EDT
Modified files:
/pear/PHPDoc prepend.php
/pear/PHPDoc/accessor PhpdocIndexAccessor.php
/pear/PHPDoc/analyser PhpdocAnalyser.php PhpdocClassAnalyser.php
/pear/PHPDoc/core Phpdoc.php PhpdocSetupHandler.php
/pear/PHPDoc/parser PhpdocParserCore.php PhpdocParserRegExp.php
PhpdocParserTags.php
/pear/PHPDoc/renderer/html PhpdocHTMLClassRenderer.php
PhpdocHTMLDocumentRenderer.php
PhpdocHTMLIndexRenderer.php
/pear/PHPDoc/xmlexporter PhpdocXMLClassExporter.php
/pear/PHPDoc/xmlwriter PhpdocXMLWriter.php
Log:
warnings
Index: pear/PHPDoc/prepend.php diff -u pear/PHPDoc/prepend.php:1.3 pear/PHPDoc/prepend.php:1.4 --- pear/PHPDoc/prepend.php:1.3 Fri Jul 26 10:49:39 2002 +++ pear/PHPDoc/prepend.php Sat Aug 17 19:11:21 2002 @@ -29,7 +29,7 @@ // 3/11/2002 Tim Gallagher<timg@sunflowerroad.com> added two defines // that are used on generated documentation // PHPDOCVERSION is the name of the tempate tag -define("PHPDOC_VERSION", "PHPDoc v1.5"); +define("PHPDOC_VERSION", "PHPDoc 0.1.0 BETA"); // PHPDOC_LINK is the name of the template tag define("PHPDOC_LINK", '<a href="http://www.phpdoc.de/">www.phpdoc.de</a'); @@ -138,29 +138,28 @@ global $_SERVER; global $PHPDOC_templates; -?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - <title>PHPDOC Version 2.0</title> + <title>PHPDOC HTML Front End</title> </head> -<body> -<font face="Arial, Helvetica" size="1"> - <table width="750"> - <tr> - <td align="left" valign="top"> - <h2><?PHP echo PHPDOC_VERSION; ?></h2> - <P>PHPDoc currently requires a late PHP4 version (4.0.3dev or above) to work. - Some earlier version like to crash with memory trouble. - PHPDoc now requires at least version 4.0.0 and <i>might</i> run with - versions prior to 4.0.3dev on a good day, but you might have problems. - </td> - <tr> - <td align="left" valign="top"><hr></td> - </tr> - <tr> - <td align="left" valign="top"> - <? include ("./front-end.php"); +<body bgcolor="white" text="black"> +<table colpadding="0" colspacing="0"> + <tr> + <td> + <h2><?PHP echo PHPDOC_VERSION; ?></h2> + <p>PHPDoc currently requires a late PHP4 version (4.0.3dev or above) to work. + Some earlier version like to crash with memory trouble. + PHPDoc now requires at least version 4.0.0 and <i>might</i> run with + versions prior to 4.0.3dev on a good day, but you might have problems.</p> + </td> + <tr> + <td><hr></td> + </tr> + <tr> + <td> + <? include ("./front-end.php"); } // end func /** * The main page footer for PHPDoc Index: pear/PHPDoc/accessor/PhpdocIndexAccessor.php diff -u pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.1 pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.2 --- pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.1 Tue May 8 00:48:35 2001 +++ pear/PHPDoc/accessor/PhpdocIndexAccessor.php Sat Aug 17 19:11:21 2002 @@ -187,20 +187,25 @@ if ($this->flagBuild["package"]) return; - $data = $this->xml["packagelist"]; + if (isset($this->xml['packagelist'])) { + $data = $this->xml["packagelist"]; + } + $this->xml = array(); $this->flagBuild["package"] = true; $this->packages = array(); - - if (!isset($data["package"][0])) - $data["package"] = array($data["package"]); + + if (!isset($data['package'][0])) + $data['package'] = array($data['package']); reset($data["package"]); while (list($k, $package) = each($data["package"])) { - - $packagename = $package["name"]; - + if (!isset($package['name'])) { + $packagename = ''; + } else { + $packagename = $package['name']; + } reset($this->packageFields); while (list($k, $field) = each($this->packageFields)) { @@ -300,7 +305,7 @@ */ function buildClasstree() { - if ($this->flagBuild["classtree"]) + if (isset($this->flagBuild['classtree']) && $this->flagBuild['classtree']) return; $this->flagBuild["classtree"] = true; Index: pear/PHPDoc/analyser/PhpdocAnalyser.php diff -u pear/PHPDoc/analyser/PhpdocAnalyser.php:1.2 pear/PHPDoc/analyser/PhpdocAnalyser.php:1.3 --- pear/PHPDoc/analyser/PhpdocAnalyser.php:1.2 Tue Aug 28 14:44:20 2001 +++ pear/PHPDoc/analyser/PhpdocAnalyser.php Sat Aug 17 19:11:21 2002 @@ -8,7 +8,7 @@ * - inherit elements * - inherit information * - * @version $Id: PhpdocAnalyser.php,v 1.2 2001/08/28 18:44:20 chagenbu Exp $ + * @version $Id: PhpdocAnalyser.php,v 1.3 2002/08/17 23:11:21 floripa Exp $ */ class PhpdocAnalyser extends PhpdocObject { @@ -235,16 +235,11 @@ // compare the informations from the parser with the @param tags reset($args); while (list($k, $arg) = each($args)) { - - if (isset($params[$k])) { - + if (is_array($params) && isset($params[$k])) { if ($arg['optional']) $params[$k]['default'] = $arg['default']; - if (!$inherited) { - if ('' != $arg['type'] && '' != $params[$k]['type'] && 'mixed' != $params[$k]['type'] && strtolower($arg['type']) != strtolower($params[$k]['type'])) { - $type = $arg['type']; $msg = sprintf('%s parameter type "%s" does not match the the documented type "%s", possible error consider an update to "@param %s %s %s" or "@param %s %s", the variable name is optional.', $this->addNumberSuffix($k + 1), @@ -275,9 +270,8 @@ } else { - if ('' != $params[$k]['type'] && strtolower($arg['type']) != strtolower($params[$k]['type'])) { - - $type = (''!=$args['type']) ? $arg['type'] : $params[$k]['type']; + if (isset($params[$k]['type']) && $params[$k]['type'] != '' && strtolower($arg['type']) != strtolower($params[$k]['type'])) { + $type = (isset($args['type']) && $args['type'] != '') ? $arg['type'] : $params[$k]['type']; $msg = sprintf('Possible documentation error due to inherited information. The type of the %s parameter "%s" does not match the documented type "%s". Override the inherited documentation if neccessary.', Index: pear/PHPDoc/analyser/PhpdocClassAnalyser.php diff -u pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.4 --- pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/analyser/PhpdocClassAnalyser.php Sat Aug 17 19:11:21 2002 @@ -2,7 +2,7 @@ /** * Analyses a class. * -* @version $Id: PhpdocClassAnalyser.php,v 1.3 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocClassAnalyser.php,v 1.4 2002/08/17 23:11:21 floripa Exp $ */ class PhpdocClassAnalyser extends PhpdocAnalyser { @@ -160,8 +160,12 @@ */ function findUndocumented($classname) { - $file = $this->classes["filename"]; - if ($this->classes["undoc"]) + if(isset($this->classes['filename'])) { + $file = $this->classes["filename"]; + } else { + $file = ''; + } + if (isset($this->classes['undoc']) && $this->classes['undoc']) $this->warn->addDocWarning($file, "class", $name, "The class is not documented.", "missing"); reset($this->undocumentedFields); @@ -192,8 +196,10 @@ reset($this->classes[$classname]["functions"]); while (list($fname, $function) = each($this->classes[$classname]["functions"])) { - - $inherited = isset($function["paraminherited"]); + $inherited = isset($function["paraminherited"]); + if (!isset($function['params'])) { + $function['params'] = ''; + } $this->classes[$classname]["functions"][$fname]["params"] = $this->checkArgDocs($function["args"], $function["params"], $fname, $file, $inherited); unset($this->classes[$classname]["functions"][$fname]["args"]); Index: pear/PHPDoc/core/Phpdoc.php diff -u pear/PHPDoc/core/Phpdoc.php:1.3 pear/PHPDoc/core/Phpdoc.php:1.4 --- pear/PHPDoc/core/Phpdoc.php:1.3 Thu Apr 11 11:11:26 2002 +++ pear/PHPDoc/core/Phpdoc.php Sat Aug 17 19:11:22 2002 @@ -3,7 +3,7 @@ * Coordinates several Phpdoc Object to parse and render source files. * * @access public -* @version $Id: Phpdoc.php,v 1.3 2002/04/11 15:11:26 timmyg Exp $ +* @version $Id: Phpdoc.php,v 1.4 2002/08/17 23:11:22 floripa Exp $ */ class Phpdoc extends PhpdocSetupHandler { @@ -19,6 +19,11 @@ * Print status messages */ var $flag_output = true; + + /** + * The Instructions have finished? + */ + var $finishInstructions = TRUE; /** * Calls the command line handler if necessary. Index: pear/PHPDoc/core/PhpdocSetupHandler.php diff -u pear/PHPDoc/core/PhpdocSetupHandler.php:1.1 pear/PHPDoc/core/PhpdocSetupHandler.php:1.2 --- pear/PHPDoc/core/PhpdocSetupHandler.php:1.1 Tue May 8 00:48:36 2001 +++ pear/PHPDoc/core/PhpdocSetupHandler.php Sat Aug 17 19:11:22 2002 @@ -5,7 +5,7 @@ * This class provides all methods neccessary to "setup" Phpdoc and check the * current setup. * -* @version $Id: PhpdocSetupHandler.php,v 1.1 2001/05/08 04:48:36 sbergmann Exp $ +* @version $Id: PhpdocSetupHandler.php,v 1.2 2002/08/17 23:11:22 floripa Exp $ * @author Ulf Wendel <ulf@redsys.de> */ class PhpdocSetupHandler extends PhpdocArgvHandler { @@ -160,7 +160,7 @@ } if (!is_dir($target)) { - $ok = mkdir($target, 0755); + $ok = @mkdir($target, 0755); if (!$ok) { $this->err[] = new PhpdocError("setTarget(), can't create a directory '$target'.", __FILE__, __LINE__); return false; Index: pear/PHPDoc/parser/PhpdocParserCore.php diff -u pear/PHPDoc/parser/PhpdocParserCore.php:1.10 pear/PHPDoc/parser/PhpdocParserCore.php:1.11 --- pear/PHPDoc/parser/PhpdocParserCore.php:1.10 Fri Aug 9 12:24:22 2002 +++ pear/PHPDoc/parser/PhpdocParserCore.php Sat Aug 17 19:11:23 2002 @@ -5,7 +5,7 @@ * Provides basic parser functions to extract doc comments, analyse tags and variable * declarations. * -* @version $Id: PhpdocParserCore.php,v 1.10 2002/08/09 16:24:22 eru Exp $ +* @version $Id: PhpdocParserCore.php,v 1.11 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserCore extends PhpdocParserTags { @@ -131,7 +131,7 @@ $paragraphs['consts'][] = array( 'name' => $name, - 'value' => ('' != $regs[4]) ? substr($regs[3], 1, -1) : $regs[3], + 'value' => (isset($regs[4]) && $regs[4] != '') ? substr($regs[3], 1, -1) : $regs[3], 'case' => $case, 'doc' => $this->extractPhpdoc(substr($phpcode, $start + 3, ($end - $start) - 2)) ); @@ -237,7 +237,7 @@ $paragraphs['consts'][] = array( 'name' => $name, - 'value' => ('' != $data[4]) ? substr($data[3], 1, -1) : $data[3], + 'value' => (isset($data[4]) && $data[4] != '') ? substr($data[3], 1, -1) : $data[3], 'case' => $case, 'doc' => '' ); Index: pear/PHPDoc/parser/PhpdocParserRegExp.php diff -u pear/PHPDoc/parser/PhpdocParserRegExp.php:1.7 pear/PHPDoc/parser/PhpdocParserRegExp.php:1.8 --- pear/PHPDoc/parser/PhpdocParserRegExp.php:1.7 Fri Jul 26 10:49:39 2002 +++ pear/PHPDoc/parser/PhpdocParserRegExp.php Sat Aug 17 19:11:23 2002 @@ -7,7 +7,7 @@ * possible I decided to define all regular expressions in one class. * From a programming point of view there's no need to do so. * -* @version $Id: PhpdocParserRegExp.php,v 1.7 2002/07/26 14:49:39 derick Exp $ +* @version $Id: PhpdocParserRegExp.php,v 1.8 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserRegExp extends PhpdocObject { @@ -444,8 +444,11 @@ 'number', 'array', 'empty_array', 'empty_resource' ); reset($elements); - while (list($key, $name) = each($elements)) - $this->PHP_COMPLEX['type_' . $name] = sprintf("@^%s@", $this->PHP_BASE[$name]); + while (list($key, $name) = each($elements)) { + if (isset($this->PHP_BASE[$name])) { + $this->PHP_COMPLEX['type_' . $name] = sprintf("@^%s@", $this->PHP_BASE[$name]); + } + } // // Regular expressions used to analyse phpdoc tags. Index: pear/PHPDoc/parser/PhpdocParserTags.php diff -u pear/PHPDoc/parser/PhpdocParserTags.php:1.5 pear/PHPDoc/parser/PhpdocParserTags.php:1.6 --- pear/PHPDoc/parser/PhpdocParserTags.php:1.5 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/parser/PhpdocParserTags.php Sat Aug 17 19:11:23 2002 @@ -2,7 +2,7 @@ /** * Functions used to parse PHPDoc Tags. * -* @version $Id: PhpdocParserTags.php,v 1.5 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocParserTags.php,v 1.6 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserTags extends PhpdocParserRegExp { @@ -287,7 +287,7 @@ } else if (!strstr($name, $this->C_BASE["module_separator"])) { - $error .= "Use function() to refer to functions and $var to referr to variables - don't know what '$name' referrs to."; + $error .= "Use function() to refer to functions and \$var to referr to variables - don't know what '$name' referrs to."; continue; } Index: pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.5 pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.6 --- pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.5 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Renders classes. * -* @version $Id: PhpdocHTMLClassRenderer.php,v 1.5 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocHTMLClassRenderer.php,v 1.6 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLClassRenderer extends PhpdocHTMLDocumentRenderer { @@ -70,7 +70,11 @@ $tplvars["CLASS_FILE"] = $class["file"]["value"]; $tplvars["CLASS_NAME"] = $class["name"]; $tplvars["CLASS_ACCESS"] = $class["access"]; - $tplvars["CLASS_PACKAGE"] = $class["package"]; + if (isset($class['package'])) { + $tplvars["CLASS_PACKAGE"] = $class["package"]; + } else { + $tplvars["CLASS_PACKAGE"] = ''; + } if ("" != $class["extends"]) $tplvars["CLASS_EXTENDS"] = sprintf('extends <a href="%s">%s</a>', @@ -80,9 +84,9 @@ $tplvars["CLASS_UNDOC"] = ("true" == $class["undoc"]) ? $this->undocumented : ""; - $tplvars["CLASS_ABSTRACT"] = ("true" == $class["abstract"]) ? "abstract" : ""; - $tplvars["CLASS_STATIC"] = ("true" == $class["static"]) ? "static" : ""; - $tplvars["CLASS_FINAL"] = ("true" == $class["final"]) ? "final" : ""; + $tplvars["CLASS_ABSTRACT"] = (isset($class['abstract']) && $class['abstract']) ? "abstract" : ""; + $tplvars["CLASS_STATIC"] = (isset($class['static']) && $class['static'] == 'true') ? "static" : ""; + $tplvars["CLASS_FINAL"] = (isset($class['final']) && $class['final'] == 'true') ? "final" : ""; $tplvars["CLASS_TREE"] = $this->getClasstree($class["name"]); @@ -298,18 +302,18 @@ while (list($name, $variable) = each($this->variables[$access])) { $tplvars = array(); - $tplvars["NAME"] = $variable["name"]; + $tplvars["NAME"] = $variable["name"]; $tplvars["ACCESS"] = $variable["access"]; $tplvars["TYPE"] = $variable["type"]; $tplvars["VALUE"] = htmlentities($variable["value"]); - if ("true" == $variable["undoc"]) + if (isset($variavle['undoc']) && $variable['undoc'] == 'true') $tplvars["UNDOC"] = $this->undocumented; - if ("true" == $variable["static"]) + if (isset($variavle['static']) && $variable['static'] == 'true') $tplvars["STATIC"] = "static"; - if ("true" == $variable["final"]) + if (isset($variavle['final']) && $variable['final'] == 'true') $tplvars["FINAL"] = "final"; if (isset($variable["doc"]["shortdescription"])) @@ -345,7 +349,8 @@ $path = $this->accessor->getClasstree(); $level = 0; $num = count($path) - 1; - + $value = ''; + for ($i = $num; $i >= 0; --$i) { $indent = $this->getIndent($level); @@ -368,7 +373,7 @@ if ($level > 0) $value.= sprintf("%s|<br>%s+-- ", $indent, $indent); - $value.= sprintf('%s<br>', $class); + $value .= sprintf('%s<br>', $class); return $value; } // end func getClasstree Index: pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.4 --- pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 Thu Dec 13 05:34:13 2001 +++ pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Provides functioninality to render modules and classes. * -* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.3 2001/12/13 10:34:13 hayk Exp $ +* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.4 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLDocumentRenderer extends PhpdocHTMLRenderer { @@ -363,13 +363,13 @@ $tplvars["NAME"] = $function["name"]; $tplvars["ACCESS"] = $function["access"]; - if ("true" == $function["undoc"]) + if (isset($function['undoc']) && $function['undoc'] == 'true') $tplvars["UNDOC"] = $this->undocumented; - if ("true" == $function["abstract"]) + if (isset($function['abstract']) && $function['abstract'] == 'true') $tplvars["ABSTRACT"] = "abstract"; - if ("true" == $function["static"]) + if (isset($function['static']) && $function["static"] == 'true') $tplvars["STATIC"] = "static"; if (isset($function["doc"]["shortdescription"])) @@ -449,7 +449,7 @@ if (isset($param["default"])) $this->tpl->setVariable("DEFAULT", "= >>".htmlentities($param["default"])."<<"); - if ("true" == $param["undoc"]) + if (isset($param['undoc']) && $param['undoc'] == 'true') $this->tpl->setVariable("UNDOC", $this->undocumented); $this->tpl->parseCurrentBlock(); @@ -468,15 +468,16 @@ if (!is_array($parameter)) return "void"; - $value = ""; - + $value = ''; if (!isset($parameter[0])) { - - if (!isset($parameter["default"])) + if (!isset($parameter["default"])) { + if (!isset($parameter['type'])) { + $parameter['type'] = ''; + } $value .= $parameter["type"] . " " . $parameter["name"]; - else + } else { $value .= "[ ".$parameter["type"] . " " . $parameter["name"]." ]"; - + } } else { $flag_optional = false; @@ -495,8 +496,11 @@ $flag_optional = true; } } - + if (!isset($param['type'])) { + $param['type'] = ''; + } $value .= $param["type"] . " " . $param["name"].", "; + } $value = substr($value, 0, -2); @@ -573,27 +577,22 @@ */ function renderAuthors($authors, $prefix = "") { - $value = ""; - + $value = ''; if (!isset($authors[0])) { - - if (isset($authors["email"])) + if (isset($authors["email"])) { $value .= sprintf('%s <<a href="mailto:%s">%s</a>>, ', $authors["value"], $authors["email"], $authors["email"]); - else - $value .= $authors["email"] . ", "; - + } else { + $value .= $authors['value'] . ', '; + } } else { - reset($authors); while (list($k, $author) = each($authors)) { - if (isset($author["email"])) $value .= sprintf('%s <<a href="mailto:%s">%s</a>>, ', $author["value"], $author["email"], $author["email"]); else - $value .= $author["email"] . ", "; + $value .= $author['value'] . ', '; } - } $value = substr($value, 0, -2); Index: pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.5 --- pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 Thu Apr 11 11:41:54 2002 +++ pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Renders Index lists. * -* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.4 2002/04/11 15:41:54 timmyg Exp $ +* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.5 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLIndexRenderer extends PhpdocHTMLRenderer { @@ -492,20 +492,19 @@ */ function buildClasstreeHTML($class) { - $html = ""; - - if (0 == count($this->classtree["classes"][$class])) { - + $html = ''; + if (isset($this->classtree['classes'][$class]) && count($this->classtree['classes'][$class]) == 0) { $html .= sprintf('<li><a href="%s">%s</a>', $this->nameToUrl($class) . $this->file_extension, $class); - } else { - $html .= sprintf('<li><a href="%s">%s</a>', $this->nameToUrl($class) . $this->file_extension, $class); $html .= "<ul>"; - reset($this->classtree["classes"][$class]); - while (list($k, $subclass) = each($this->classtree["classes"][$class])) - $html .= $this->buildClasstreeHTML($subclass); + if (isset($this->classtree['classes'][$class])) { + reset($this->classtree['classes'][$class]); + while (list($k, $subclass) = each($this->classtree["classes"][$class])) { + $html .= $this->buildClasstreeHTML($subclass); + } + } $html .= "</ul>"; Index: pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php diff -u pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2 --- pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 Tue May 8 00:48:40 2001 +++ pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php Sat Aug 17 19:11:25 2002 @@ -2,7 +2,7 @@ /** * Exports the data of a class as an xml file. * -* @version $Id: PhpdocXMLClassExporter.php,v 1.1 2001/05/08 04:48:40 sbergmann Exp $ +* @version $Id: PhpdocXMLClassExporter.php,v 1.2 2002/08/17 23:11:25 floripa Exp $ */ class PhpdocXMLClassExporter extends PhpdocXMLDocumentExporter { @@ -166,18 +166,16 @@ * @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); + if (!isset($data['value'])) { + $data['value'] = ''; + } + $this->xmlwriter->startElement('variable', $data['value'], $attribs, false); $this->docXML($data); - $this->xmlwriter->endElement("variable", true); - + $this->xmlwriter->endElement('variable', true); } - } // end func variablesXML - } // end class PhpdocXMLClassExporter ?> Index: pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php diff -u pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.1 pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 --- pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.1 Tue May 8 00:48:47 2001 +++ pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php Sat Aug 17 19:11:25 2002 @@ -6,7 +6,7 @@ * not much what this class can do but it provides some simple * functions to handle attributes and hides file handling tasks. * -* @version $Id: PhpdocXMLWriter.php,v 1.1 2001/05/08 04:48:47 sbergmann Exp $ +* @version $Id: PhpdocXMLWriter.php,v 1.2 2002/08/17 23:11:25 floripa Exp $ */ class PhpdocXMLWriter extends PhpdocObject { @@ -168,6 +168,7 @@ function xmlencode($value) { # return preg_replace( array("@<@", "@>@", "@'@", '@"@', "@&@", "@" . PHPDOC_LINEBREAK ."@", "@\n@", "@\r@"), array("<", ">", "'", """, "&", '
', '
', '
'), $value); return utf8_encode(preg_replace( array("@<@", "@>@", "@'@", '@"@', "@&@", "@" . PHPDOC_LINEBREAK . "@", "@\n@", "@\r@"), array("<", ">", "'", """, "&", '
', '
', '
'), $value)); + } // end func xmlencode } // end class PhpdocXMLWriter
Index: pear/PHPDoc/prepend.php diff -u pear/PHPDoc/prepend.php:1.3 pear/PHPDoc/prepend.php:1.4 --- pear/PHPDoc/prepend.php:1.3 Fri Jul 26 10:49:39 2002 +++ pear/PHPDoc/prepend.php Sat Aug 17 19:11:21 2002 @@ -29,7 +29,7 @@ // 3/11/2002 Tim Gallagher<timg@sunflowerroad.com> added two defines // that are used on generated documentation // PHPDOCVERSION is the name of the tempate tag -define("PHPDOC_VERSION", "PHPDoc v1.5"); +define("PHPDOC_VERSION", "PHPDoc 0.1.0 BETA"); // PHPDOC_LINK is the name of the template tag define("PHPDOC_LINK", '<a href="http://www.phpdoc.de/">www.phpdoc.de</a'); @@ -138,29 +138,28 @@ global $_SERVER; global $PHPDOC_templates; -?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - <title>PHPDOC Version 2.0</title> + <title>PHPDOC HTML Front End</title> </head> -<body> -<font face="Arial, Helvetica" size="1"> - <table width="750"> - <tr> - <td align="left" valign="top"> - <h2><?PHP echo PHPDOC_VERSION; ?></h2> - <P>PHPDoc currently requires a late PHP4 version (4.0.3dev or above) to work. - Some earlier version like to crash with memory trouble. - PHPDoc now requires at least version 4.0.0 and <i>might</i> run with - versions prior to 4.0.3dev on a good day, but you might have problems. - </td> - <tr> - <td align="left" valign="top"><hr></td> - </tr> - <tr> - <td align="left" valign="top"> - <? include ("./front-end.php"); +<body bgcolor="white" text="black"> +<table colpadding="0" colspacing="0"> + <tr> + <td> + <h2><?PHP echo PHPDOC_VERSION; ?></h2> + <p>PHPDoc currently requires a late PHP4 version (4.0.3dev or above) to work. + Some earlier version like to crash with memory trouble. + PHPDoc now requires at least version 4.0.0 and <i>might</i> run with + versions prior to 4.0.3dev on a good day, but you might have problems.</p> + </td> + <tr> + <td><hr></td> + </tr> + <tr> + <td> + <? include ("./front-end.php"); } // end func /** * The main page footer for PHPDoc Index: pear/PHPDoc/accessor/PhpdocIndexAccessor.php diff -u pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.1 pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.2 --- pear/PHPDoc/accessor/PhpdocIndexAccessor.php:1.1 Tue May 8 00:48:35 2001 +++ pear/PHPDoc/accessor/PhpdocIndexAccessor.php Sat Aug 17 19:11:21 2002 @@ -187,20 +187,25 @@ if ($this->flagBuild["package"]) return; - $data = $this->xml["packagelist"]; + if (isset($this->xml['packagelist'])) { + $data = $this->xml["packagelist"]; + } + $this->xml = array(); $this->flagBuild["package"] = true; $this->packages = array(); - - if (!isset($data["package"][0])) - $data["package"] = array($data["package"]); + + if (!isset($data['package'][0])) + $data['package'] = array($data['package']); reset($data["package"]); while (list($k, $package) = each($data["package"])) { - - $packagename = $package["name"]; - + if (!isset($package['name'])) { + $packagename = ''; + } else { + $packagename = $package['name']; + } reset($this->packageFields); while (list($k, $field) = each($this->packageFields)) { @@ -300,7 +305,7 @@ */ function buildClasstree() { - if ($this->flagBuild["classtree"]) + if (isset($this->flagBuild['classtree']) && $this->flagBuild['classtree']) return; $this->flagBuild["classtree"] = true; Index: pear/PHPDoc/analyser/PhpdocAnalyser.php diff -u pear/PHPDoc/analyser/PhpdocAnalyser.php:1.2 pear/PHPDoc/analyser/PhpdocAnalyser.php:1.3 --- pear/PHPDoc/analyser/PhpdocAnalyser.php:1.2 Tue Aug 28 14:44:20 2001 +++ pear/PHPDoc/analyser/PhpdocAnalyser.php Sat Aug 17 19:11:21 2002 @@ -8,7 +8,7 @@ * - inherit elements * - inherit information * - * @version $Id: PhpdocAnalyser.php,v 1.2 2001/08/28 18:44:20 chagenbu Exp $ + * @version $Id: PhpdocAnalyser.php,v 1.3 2002/08/17 23:11:21 floripa Exp $ */ class PhpdocAnalyser extends PhpdocObject { @@ -235,16 +235,11 @@ // compare the informations from the parser with the @param tags reset($args); while (list($k, $arg) = each($args)) { - - if (isset($params[$k])) { - + if (is_array($params) && isset($params[$k])) { if ($arg['optional']) $params[$k]['default'] = $arg['default']; - if (!$inherited) { - if ('' != $arg['type'] && '' != $params[$k]['type'] && 'mixed' != $params[$k]['type'] && strtolower($arg['type']) != strtolower($params[$k]['type'])) { - $type = $arg['type']; $msg = sprintf('%s parameter type "%s" does not match the the documented type "%s", possible error consider an update to "@param %s %s %s" or "@param %s %s", the variable name is optional.', $this->addNumberSuffix($k + 1), @@ -275,9 +270,8 @@ } else { - if ('' != $params[$k]['type'] && strtolower($arg['type']) != strtolower($params[$k]['type'])) { - - $type = (''!=$args['type']) ? $arg['type'] : $params[$k]['type']; + if (isset($params[$k]['type']) && $params[$k]['type'] != '' && strtolower($arg['type']) != strtolower($params[$k]['type'])) { + $type = (isset($args['type']) && $args['type'] != '') ? $arg['type'] : $params[$k]['type']; $msg = sprintf('Possible documentation error due to inherited information. The type of the %s parameter "%s" does not match the documented type "%s". Override the inherited documentation if neccessary.', Index: pear/PHPDoc/analyser/PhpdocClassAnalyser.php diff -u pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.4 --- pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/analyser/PhpdocClassAnalyser.php Sat Aug 17 19:11:21 2002 @@ -2,7 +2,7 @@ /** * Analyses a class. * -* @version $Id: PhpdocClassAnalyser.php,v 1.3 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocClassAnalyser.php,v 1.4 2002/08/17 23:11:21 floripa Exp $ */ class PhpdocClassAnalyser extends PhpdocAnalyser { @@ -160,8 +160,12 @@ */ function findUndocumented($classname) { - $file = $this->classes["filename"]; - if ($this->classes["undoc"]) + if(isset($this->classes['filename'])) { + $file = $this->classes["filename"]; + } else { + $file = ''; + } + if (isset($this->classes['undoc']) && $this->classes['undoc']) $this->warn->addDocWarning($file, "class", $name, "The class is not documented.", "missing"); reset($this->undocumentedFields); @@ -192,8 +196,10 @@ reset($this->classes[$classname]["functions"]); while (list($fname, $function) = each($this->classes[$classname]["functions"])) { - - $inherited = isset($function["paraminherited"]); + $inherited = isset($function["paraminherited"]); + if (!isset($function['params'])) { + $function['params'] = ''; + } $this->classes[$classname]["functions"][$fname]["params"] = $this->checkArgDocs($function["args"], $function["params"], $fname, $file, $inherited); unset($this->classes[$classname]["functions"][$fname]["args"]); Index: pear/PHPDoc/core/Phpdoc.php diff -u pear/PHPDoc/core/Phpdoc.php:1.3 pear/PHPDoc/core/Phpdoc.php:1.4 --- pear/PHPDoc/core/Phpdoc.php:1.3 Thu Apr 11 11:11:26 2002 +++ pear/PHPDoc/core/Phpdoc.php Sat Aug 17 19:11:22 2002 @@ -3,7 +3,7 @@ * Coordinates several Phpdoc Object to parse and render source files. * * @access public -* @version $Id: Phpdoc.php,v 1.3 2002/04/11 15:11:26 timmyg Exp $ +* @version $Id: Phpdoc.php,v 1.4 2002/08/17 23:11:22 floripa Exp $ */ class Phpdoc extends PhpdocSetupHandler { @@ -19,6 +19,11 @@ * Print status messages */ var $flag_output = true; + + /** + * The Instructions have finished? + */ + var $finishInstructions = TRUE; /** * Calls the command line handler if necessary. Index: pear/PHPDoc/core/PhpdocSetupHandler.php diff -u pear/PHPDoc/core/PhpdocSetupHandler.php:1.1 pear/PHPDoc/core/PhpdocSetupHandler.php:1.2 --- pear/PHPDoc/core/PhpdocSetupHandler.php:1.1 Tue May 8 00:48:36 2001 +++ pear/PHPDoc/core/PhpdocSetupHandler.php Sat Aug 17 19:11:22 2002 @@ -5,7 +5,7 @@ * This class provides all methods neccessary to "setup" Phpdoc and check the * current setup. * -* @version $Id: PhpdocSetupHandler.php,v 1.1 2001/05/08 04:48:36 sbergmann Exp $ +* @version $Id: PhpdocSetupHandler.php,v 1.2 2002/08/17 23:11:22 floripa Exp $ * @author Ulf Wendel <ulf@redsys.de> */ class PhpdocSetupHandler extends PhpdocArgvHandler { @@ -160,7 +160,7 @@ } if (!is_dir($target)) { - $ok = mkdir($target, 0755); + $ok = @mkdir($target, 0755); if (!$ok) { $this->err[] = new PhpdocError("setTarget(), can't create a directory '$target'.", __FILE__, __LINE__); return false; Index: pear/PHPDoc/parser/PhpdocParserCore.php diff -u pear/PHPDoc/parser/PhpdocParserCore.php:1.10 pear/PHPDoc/parser/PhpdocParserCore.php:1.11 --- pear/PHPDoc/parser/PhpdocParserCore.php:1.10 Fri Aug 9 12:24:22 2002 +++ pear/PHPDoc/parser/PhpdocParserCore.php Sat Aug 17 19:11:23 2002 @@ -5,7 +5,7 @@ * Provides basic parser functions to extract doc comments, analyse tags and variable * declarations. * -* @version $Id: PhpdocParserCore.php,v 1.10 2002/08/09 16:24:22 eru Exp $ +* @version $Id: PhpdocParserCore.php,v 1.11 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserCore extends PhpdocParserTags { @@ -131,7 +131,7 @@ $paragraphs['consts'][] = array( 'name' => $name, - 'value' => ('' != $regs[4]) ? substr($regs[3], 1, -1) : $regs[3], + 'value' => (isset($regs[4]) && $regs[4] != '') ? substr($regs[3], 1, -1) : $regs[3], 'case' => $case, 'doc' => $this->extractPhpdoc(substr($phpcode, $start + 3, ($end - $start) - 2)) ); @@ -237,7 +237,7 @@ $paragraphs['consts'][] = array( 'name' => $name, - 'value' => ('' != $data[4]) ? substr($data[3], 1, -1) : $data[3], + 'value' => (isset($data[4]) && $data[4] != '') ? substr($data[3], 1, -1) : $data[3], 'case' => $case, 'doc' => '' ); Index: pear/PHPDoc/parser/PhpdocParserRegExp.php diff -u pear/PHPDoc/parser/PhpdocParserRegExp.php:1.7 pear/PHPDoc/parser/PhpdocParserRegExp.php:1.8 --- pear/PHPDoc/parser/PhpdocParserRegExp.php:1.7 Fri Jul 26 10:49:39 2002 +++ pear/PHPDoc/parser/PhpdocParserRegExp.php Sat Aug 17 19:11:23 2002 @@ -7,7 +7,7 @@ * possible I decided to define all regular expressions in one class. * From a programming point of view there's no need to do so. * -* @version $Id: PhpdocParserRegExp.php,v 1.7 2002/07/26 14:49:39 derick Exp $ +* @version $Id: PhpdocParserRegExp.php,v 1.8 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserRegExp extends PhpdocObject { @@ -444,8 +444,11 @@ 'number', 'array', 'empty_array', 'empty_resource' ); reset($elements); - while (list($key, $name) = each($elements)) - $this->PHP_COMPLEX['type_' . $name] = sprintf("@^%s@", $this->PHP_BASE[$name]); + while (list($key, $name) = each($elements)) { + if (isset($this->PHP_BASE[$name])) { + $this->PHP_COMPLEX['type_' . $name] = sprintf("@^%s@", $this->PHP_BASE[$name]); + } + } // // Regular expressions used to analyse phpdoc tags. Index: pear/PHPDoc/parser/PhpdocParserTags.php diff -u pear/PHPDoc/parser/PhpdocParserTags.php:1.5 pear/PHPDoc/parser/PhpdocParserTags.php:1.6 --- pear/PHPDoc/parser/PhpdocParserTags.php:1.5 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/parser/PhpdocParserTags.php Sat Aug 17 19:11:23 2002 @@ -2,7 +2,7 @@ /** * Functions used to parse PHPDoc Tags. * -* @version $Id: PhpdocParserTags.php,v 1.5 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocParserTags.php,v 1.6 2002/08/17 23:11:23 floripa Exp $ */ class PhpdocParserTags extends PhpdocParserRegExp { @@ -287,7 +287,7 @@ } else if (!strstr($name, $this->C_BASE["module_separator"])) { - $error .= "Use function() to refer to functions and $var to referr to variables - don't know what '$name' referrs to."; + $error .= "Use function() to refer to functions and \$var to referr to variables - don't know what '$name' referrs to."; continue; } Index: pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.5 pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.6 --- pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.5 Sun Jul 28 07:17:36 2002 +++ pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Renders classes. * -* @version $Id: PhpdocHTMLClassRenderer.php,v 1.5 2002/07/28 11:17:36 derick Exp $ +* @version $Id: PhpdocHTMLClassRenderer.php,v 1.6 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLClassRenderer extends PhpdocHTMLDocumentRenderer { @@ -70,7 +70,11 @@ $tplvars["CLASS_FILE"] = $class["file"]["value"]; $tplvars["CLASS_NAME"] = $class["name"]; $tplvars["CLASS_ACCESS"] = $class["access"]; - $tplvars["CLASS_PACKAGE"] = $class["package"]; + if (isset($class['package'])) { + $tplvars["CLASS_PACKAGE"] = $class["package"]; + } else { + $tplvars["CLASS_PACKAGE"] = ''; + } if ("" != $class["extends"]) $tplvars["CLASS_EXTENDS"] = sprintf('extends <a href="%s">%s</a>', @@ -80,9 +84,9 @@ $tplvars["CLASS_UNDOC"] = ("true" == $class["undoc"]) ? $this->undocumented : ""; - $tplvars["CLASS_ABSTRACT"] = ("true" == $class["abstract"]) ? "abstract" : ""; - $tplvars["CLASS_STATIC"] = ("true" == $class["static"]) ? "static" : ""; - $tplvars["CLASS_FINAL"] = ("true" == $class["final"]) ? "final" : ""; + $tplvars["CLASS_ABSTRACT"] = (isset($class['abstract']) && $class['abstract']) ? "abstract" : ""; + $tplvars["CLASS_STATIC"] = (isset($class['static']) && $class['static'] == 'true') ? "static" : ""; + $tplvars["CLASS_FINAL"] = (isset($class['final']) && $class['final'] == 'true') ? "final" : ""; $tplvars["CLASS_TREE"] = $this->getClasstree($class["name"]); @@ -298,18 +302,18 @@ while (list($name, $variable) = each($this->variables[$access])) { $tplvars = array(); - $tplvars["NAME"] = $variable["name"]; + $tplvars["NAME"] = $variable["name"]; $tplvars["ACCESS"] = $variable["access"]; $tplvars["TYPE"] = $variable["type"]; $tplvars["VALUE"] = htmlentities($variable["value"]); - if ("true" == $variable["undoc"]) + if (isset($variavle['undoc']) && $variable['undoc'] == 'true') $tplvars["UNDOC"] = $this->undocumented; - if ("true" == $variable["static"]) + if (isset($variavle['static']) && $variable['static'] == 'true') $tplvars["STATIC"] = "static"; - if ("true" == $variable["final"]) + if (isset($variavle['final']) && $variable['final'] == 'true') $tplvars["FINAL"] = "final"; if (isset($variable["doc"]["shortdescription"])) @@ -345,7 +349,8 @@ $path = $this->accessor->getClasstree(); $level = 0; $num = count($path) - 1; - + $value = ''; + for ($i = $num; $i >= 0; --$i) { $indent = $this->getIndent($level); @@ -368,7 +373,7 @@ if ($level > 0) $value.= sprintf("%s|<br>%s+-- ", $indent, $indent); - $value.= sprintf('%s<br>', $class); + $value .= sprintf('%s<br>', $class); return $value; } // end func getClasstree Index: pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.4 --- pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 Thu Dec 13 05:34:13 2001 +++ pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Provides functioninality to render modules and classes. * -* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.3 2001/12/13 10:34:13 hayk Exp $ +* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.4 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLDocumentRenderer extends PhpdocHTMLRenderer { @@ -363,13 +363,13 @@ $tplvars["NAME"] = $function["name"]; $tplvars["ACCESS"] = $function["access"]; - if ("true" == $function["undoc"]) + if (isset($function['undoc']) && $function['undoc'] == 'true') $tplvars["UNDOC"] = $this->undocumented; - if ("true" == $function["abstract"]) + if (isset($function['abstract']) && $function['abstract'] == 'true') $tplvars["ABSTRACT"] = "abstract"; - if ("true" == $function["static"]) + if (isset($function['static']) && $function["static"] == 'true') $tplvars["STATIC"] = "static"; if (isset($function["doc"]["shortdescription"])) @@ -449,7 +449,7 @@ if (isset($param["default"])) $this->tpl->setVariable("DEFAULT", "= >>".htmlentities($param["default"])."<<"); - if ("true" == $param["undoc"]) + if (isset($param['undoc']) && $param['undoc'] == 'true') $this->tpl->setVariable("UNDOC", $this->undocumented); $this->tpl->parseCurrentBlock(); @@ -468,15 +468,16 @@ if (!is_array($parameter)) return "void"; - $value = ""; - + $value = ''; if (!isset($parameter[0])) { - - if (!isset($parameter["default"])) + if (!isset($parameter["default"])) { + if (!isset($parameter['type'])) { + $parameter['type'] = ''; + } $value .= $parameter["type"] . " " . $parameter["name"]; - else + } else { $value .= "[ ".$parameter["type"] . " " . $parameter["name"]." ]"; - + } } else { $flag_optional = false; @@ -495,8 +496,11 @@ $flag_optional = true; } } - + if (!isset($param['type'])) { + $param['type'] = ''; + } $value .= $param["type"] . " " . $param["name"].", "; + } $value = substr($value, 0, -2); @@ -573,27 +577,22 @@ */ function renderAuthors($authors, $prefix = "") { - $value = ""; - + $value = ''; if (!isset($authors[0])) { - - if (isset($authors["email"])) + if (isset($authors["email"])) { $value .= sprintf('%s <<a href="mailto:%s">%s</a>>, ', $authors["value"], $authors["email"], $authors["email"]); - else - $value .= $authors["email"] . ", "; - + } else { + $value .= $authors['value'] . ', '; + } } else { - reset($authors); while (list($k, $author) = each($authors)) { - if (isset($author["email"])) $value .= sprintf('%s <<a href="mailto:%s">%s</a>>, ', $author["value"], $author["email"], $author["email"]); else - $value .= $author["email"] . ", "; + $value .= $author['value'] . ', '; } - } $value = substr($value, 0, -2); Index: pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.5 --- pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 Thu Apr 11 11:41:54 2002 +++ pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php Sat Aug 17 19:11:24 2002 @@ -2,7 +2,7 @@ /** * Renders Index lists. * -* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.4 2002/04/11 15:41:54 timmyg Exp $ +* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.5 2002/08/17 23:11:24 floripa Exp $ */ class PhpdocHTMLIndexRenderer extends PhpdocHTMLRenderer { @@ -492,20 +492,19 @@ */ function buildClasstreeHTML($class) { - $html = ""; - - if (0 == count($this->classtree["classes"][$class])) { - + $html = ''; + if (isset($this->classtree['classes'][$class]) && count($this->classtree['classes'][$class]) == 0) { $html .= sprintf('<li><a href="%s">%s</a>', $this->nameToUrl($class) . $this->file_extension, $class); - } else { - $html .= sprintf('<li><a href="%s">%s</a>', $this->nameToUrl($class) . $this->file_extension, $class); $html .= "<ul>"; - reset($this->classtree["classes"][$class]); - while (list($k, $subclass) = each($this->classtree["classes"][$class])) - $html .= $this->buildClasstreeHTML($subclass); + if (isset($this->classtree['classes'][$class])) { + reset($this->classtree['classes'][$class]); + while (list($k, $subclass) = each($this->classtree["classes"][$class])) { + $html .= $this->buildClasstreeHTML($subclass); + } + } $html .= "</ul>"; Index: pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php diff -u pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2 --- pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 Tue May 8 00:48:40 2001 +++ pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php Sat Aug 17 19:11:25 2002 @@ -2,7 +2,7 @@ /** * Exports the data of a class as an xml file. * -* @version $Id: PhpdocXMLClassExporter.php,v 1.1 2001/05/08 04:48:40 sbergmann Exp $ +* @version $Id: PhpdocXMLClassExporter.php,v 1.2 2002/08/17 23:11:25 floripa Exp $ */ class PhpdocXMLClassExporter extends PhpdocXMLDocumentExporter { @@ -166,18 +166,16 @@ * @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); + if (!isset($data['value'])) { + $data['value'] = ''; + } + $this->xmlwriter->startElement('variable', $data['value'], $attribs, false); $this->docXML($data); - $this->xmlwriter->endElement("variable", true); - + $this->xmlwriter->endElement('variable', true); } - } // end func variablesXML - } // end class PhpdocXMLClassExporter ?> Index: pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php diff -u pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.1 pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 --- pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.1 Tue May 8 00:48:47 2001 +++ pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php Sat Aug 17 19:11:25 2002 @@ -6,7 +6,7 @@ * not much what this class can do but it provides some simple * functions to handle attributes and hides file handling tasks. * -* @version $Id: PhpdocXMLWriter.php,v 1.1 2001/05/08 04:48:47 sbergmann Exp $ +* @version $Id: PhpdocXMLWriter.php,v 1.2 2002/08/17 23:11:25 floripa Exp $ */ class PhpdocXMLWriter extends PhpdocObject { @@ -168,6 +168,7 @@ function xmlencode($value) { # return preg_replace( array("@<@", "@>@", "@'@", '@"@', "@&@", "@" . PHPDOC_LINEBREAK ."@", "@\n@", "@\r@"), array("<", ">", "'", """, "&", '
', '
', '
'), $value); return utf8_encode(preg_replace( array("@<@", "@>@", "@'@", '@"@', "@&@", "@" . PHPDOC_LINEBREAK . "@", "@\n@", "@\r@"), array("<", ">", "'", """, "&", '
', '
', '
'), $value)); + } // end func xmlencode } // end class PhpdocXMLWriter