cvs: pear /PhpDocumentor Release-1.3.0 package.xml package2.xml /PhpDocumentor/phpDocumentor Classes.inc Converter.inc ParserElements.inc
/PhpDocumentor/scripts create_package.xml.php

From: Date: Sun, 26 Feb 2006 02:39:51 +0000
Subject: cvs: pear /PhpDocumentor Release-1.3.0 package.xml package2.xml /PhpDocumentor/phpDocumentor Classes.inc Converter.inc ParserElements.inc
/PhpDocumentor/scripts create_package.xml.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38625@lists.php.net to get a copy of this message
cellog Sun Feb 26 02:39:51 2006 UTC Modified files: /pear/PhpDocumentor Release-1.3.0 package.xml package2.xml /pear/PhpDocumentor/phpDocumentor Classes.inc Converter.inc ParserElements.inc /pear/PhpDocumentor/scripts create_package.xml.php Log: add use of Reflection to document extension of internal classes (fixes sourceforge bug [ 907734 ] Exception Class is builtin to PHP5) internal interfaces are not yet supported also, a few more WS/CS issues

http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/Release-1.3.0?r1=1.1&r2=1.2&diff_format=u Index: pear/PhpDocumentor/Release-1.3.0 diff -u pear/PhpDocumentor/Release-1.3.0:1.1 pear/PhpDocumentor/Release-1.3.0:1.2 --- pear/PhpDocumentor/Release-1.3.0:1.1 Mon Oct 17 18:15:16 2005 +++ pear/PhpDocumentor/Release-1.3.0 Sun Feb 26 02:39:50 2006 @@ -1,4 +1,4 @@ -$Id: Release-1.3.0,v 1.1 2005/10/17 18:15:16 jeichorn Exp $ +$Id: Release-1.3.0,v 1.2 2006/02/26 02:39:50 cellog Exp $ PhpDocumentor Version 1.3.0 ################################################################################ @@ -11,17 +11,19 @@ The phpDocumentor team would like to announce the release of phpDocumentor 1.3.0. This release adds in PHP 5 support, highlighting of tutorial XML, beautifying of output from the XML:DocBook/peardoc2:default converter, -and fixes a few bugs found in 1.2.3.1. In addition, output from source highlighting -is much more efficient, resulting in slightly smaller file size for sourcecode=on. -Also, multi-national characters are now allowed in a package name - at your own risk. -I found that Apache 1.3 could not serve files with multi-national characters, but -when loaded directly from disk, web browsers did just fine. +and fixes more than 100 bugs found in 1.2.3.1. In addition, output from +source highlighting is much more efficient, resulting in slightly smaller +file size for sourcecode=on. Also, multi-national characters are now +allowed in a package name - at your own risk. I found that Apache 1.3 +could not serve files with multi-national characters, but when loaded +directly from disk, web browsers did just fine. ------ IMPORTANT: phpDocumentor 1.3.0 requires PHP version 4.2.0 or greater. phpDocumentor will function best with PHP version 4.3.0 or greater, as it will use of the tokenizer extension if php 4.3.0 is installed for a tremendous -increase in parsing speed. +increase in parsing speed. PHP version 5.1.0 or newer is recommended to take +advantage of PHP5-only features. ------ WARNING: The PDF Converter will not work in PHP5. The PDF library that it relies upon segfaults with the simplest of files. Generation still works great in PHP4 @@ -47,6 +49,9 @@ ################################################################################ The following bugs are fixed in version 1.3.0 + [ not entered ] phpdoc script broken on unix + [ not entered ] XMLDocBookpeardoc2 beautifier removes comments + [ 893186 ] HTMLframes converter sometimes misses package level docs [ 834941 ] inline @link doesn't work within <b> [ 839092 ] CHM:default:default produces bad links [ 839466 ] {$array['Key']} in heredoc @@ -74,10 +79,45 @@ [ 892479 ] {@link} in // comment is escaped [ 893470 ] __clone called directly in PackagePageElements.inc [ 895656 ] initialized private variables not recognized as private + [ 896444 ] Bad line numbers [ 904823 ] IntermediateParser fatal error + [ 907734 ] Exception Class is builtin to PHP5 [ 910676 ] Fatal error: Smarty error: unable to write to $compile_dir [ 915770 ] Classes in file not showing [ 924313 ] Objec access on array + [ 937235 ] duplicated /** after abstract method declaration + [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index + [ 952217 ] HTML:frames:earthli + [ 962319 ] Define : don\'t show the assigned value + [ 977674 ] Parser error + [ 989258 ] wrong interfaces parsing + [ 1016927 ] no highlight for paramtype in header of function + [ 1108018 ] Bad source code after /**#@-*/ + [ 1145403 ] Call to a member function on a non-object + [ 1150809 ] Infinite loop when class extends itself + [ 1151196 ] PHP Fatal error: Cannot re-assign $this + [ 1151650 ] UTF8 decoding for DocBook packages + [ 1152781 ] PHP_NOTICE: Uninitialized string offset in ParserDescCleanup + [ 1153593 ] string id="...." in tutorials + [ 1164253 ] Inherited Class Constants are not displayed + [ 1171583 ] CHM wrong filesource + [ 1180200 ] HighlightParser does not handle Heredoc Blocks. + [ 1202772 ] missing parentheses in Parser.inc line 946 + [ 1203445 ] Call to a member function on a non-object in Parser.inc + [ 1203451 ] array to string conversion notice in InlineTags.inc + [ 1224317 ] functions refers to wrong line + [ 1255692 ] Support for "--" argument + [ 1261287 ] @filesource bug? + [ 1348852 ] Call to function Convert() on a non-object + DocBlockTags + [ 1366260 ] Default 0 parameter in method is not displayed + [ 1393998 ] HTMLSmartyConverter Fatal error (line 627) fix + [ 1398977 ] @return is not merged when using DocBlock Templates + [ 1428660 ] Confusing error when using {@link} in @uses +- fixed these bugs reported in PEAR: + Bug #2288: Webfrontend ignores more than one dir in "Files to ignore" + Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser + Bug #6848: Reference Patch There of course were other small bugs fixed, these were just the bugs with entries in source forge. You can view the bug details or reopen it if http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/package.xml?r1=1.27&r2=1.28&diff_format=u Index: pear/PhpDocumentor/package.xml diff -u pear/PhpDocumentor/package.xml:1.27 pear/PhpDocumentor/package.xml:1.28 --- pear/PhpDocumentor/package.xml:1.27 Sat Feb 25 04:53:08 2006 +++ pear/PhpDocumentor/package.xml Sun Feb 26 02:39:50 2006 @@ -68,7 +68,7 @@ </maintainers> <release> <version>1.3.0RC6</version> - <date>2006-02-24</date> + <date>2006-02-25</date> <license>PHP License</license> <state>beta</state> <notes>PHP 5 support and more, fix bugs @@ -81,7 +81,8 @@ Features added to this release include: * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2 - language constructs. Note that you must be running phpDocumentor in + language constructs. Internal classes are recognized and inheritance is + documented. Note that you must be running phpDocumentor in PHP 5 in order to parse PHP 5 code * XML:DocBook/peardoc2:default converter now beautifies the source using PEAR&apos;s XML_Beautifier if available @@ -135,6 +136,7 @@ [ not entered ] XMLDocBookpeardoc2 beautifier removes comments [ 893186 ] HTMLframes converter sometimes misses package level docs [ 896444 ] Bad line numbers + [ 907734 ] Exception Class is builtin to PHP5 [ 937235 ] duplicated /** after abstract method declaration [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index [ 952217 ] HTML:frames:earthli @@ -2366,7 +2368,7 @@ </release> <release> <version>1.3.0RC6</version> - <date>2006-02-24</date> + <date>2006-02-25</date> <license>PHP License</license> <state>beta</state> <notes>PHP 5 support and more, fix bugs @@ -2379,7 +2381,8 @@ Features added to this release include: * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2 - language constructs. Note that you must be running phpDocumentor in + language constructs. Internal classes are recognized and inheritance is + documented. Note that you must be running phpDocumentor in PHP 5 in order to parse PHP 5 code * XML:DocBook/peardoc2:default converter now beautifies the source using PEAR&apos;s XML_Beautifier if available @@ -2433,6 +2436,7 @@ [ not entered ] XMLDocBookpeardoc2 beautifier removes comments [ 893186 ] HTMLframes converter sometimes misses package level docs [ 896444 ] Bad line numbers + [ 907734 ] Exception Class is builtin to PHP5 [ 937235 ] duplicated /** after abstract method declaration [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index [ 952217 ] HTML:frames:earthli http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/package2.xml?r1=1.19&r2=1.20&diff_format=u Index: pear/PhpDocumentor/package2.xml diff -u pear/PhpDocumentor/package2.xml:1.19 pear/PhpDocumentor/package2.xml:1.20 --- pear/PhpDocumentor/package2.xml:1.19 Sat Feb 25 04:53:08 2006 +++ pear/PhpDocumentor/package2.xml Sun Feb 26 02:39:50 2006 @@ -63,8 +63,8 @@ <email>drewish@php.net</email> <active>yes</active> </developer> - <date>2006-02-24</date> - <time>22:52:33</time> + <date>2006-02-25</date> + <time>20:38:41</time> <version> <release>1.3.0RC6</release> <api>1.3.0</api> @@ -84,7 +84,8 @@ Features added to this release include: * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2 - language constructs. Note that you must be running phpDocumentor in + language constructs. Internal classes are recognized and inheritance is + documented. Note that you must be running phpDocumentor in PHP 5 in order to parse PHP 5 code * XML:DocBook/peardoc2:default converter now beautifies the source using PEAR&apos;s XML_Beautifier if available @@ -138,6 +139,7 @@ [ not entered ] XMLDocBookpeardoc2 beautifier removes comments [ 893186 ] HTMLframes converter sometimes misses package level docs [ 896444 ] Bad line numbers + [ 907734 ] Exception Class is builtin to PHP5 [ 937235 ] duplicated /** after abstract method declaration [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index [ 952217 ] HTML:frames:earthli @@ -1579,7 +1581,7 @@ <dependencies> <required> <php> - <min>4.1.0</min> + <min>4.2.0</min> </php> <pearinstaller> <min>1.4.6</min> @@ -2532,7 +2534,7 @@ <release>beta</release> <api>beta</api> </stability> - <date>2006-02-24</date> + <date>2006-02-25</date> <license uri="http://www.php.net/license">PHP License</license> <notes>PHP 5 support and more, fix bugs @@ -2544,7 +2546,8 @@ Features added to this release include: * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2 - language constructs. Note that you must be running phpDocumentor in + language constructs. Internal classes are recognized and inheritance is + documented. Note that you must be running phpDocumentor in PHP 5 in order to parse PHP 5 code * XML:DocBook/peardoc2:default converter now beautifies the source using PEAR&apos;s XML_Beautifier if available @@ -2598,6 +2601,7 @@ [ not entered ] XMLDocBookpeardoc2 beautifier removes comments [ 893186 ] HTMLframes converter sometimes misses package level docs [ 896444 ] Bad line numbers + [ 907734 ] Exception Class is builtin to PHP5 [ 937235 ] duplicated /** after abstract method declaration [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index [ 952217 ] HTML:frames:earthli http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/Classes.inc?r1=1.5&r2=1.6&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Classes.inc diff -u pear/PhpDocumentor/phpDocumentor/Classes.inc:1.5 pear/PhpDocumentor/phpDocumentor/Classes.inc:1.6 --- pear/PhpDocumentor/phpDocumentor/Classes.inc:1.5 Thu Feb 23 15:09:18 2006 +++ pear/PhpDocumentor/phpDocumentor/Classes.inc Sun Feb 26 02:39:50 2006 @@ -22,7 +22,7 @@ * @package phpDocumentor * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: Classes.inc,v 1.5 2006/02/23 15:09:18 cellog Exp $ + * @version $Id: Classes.inc,v 1.6 2006/02/26 02:39:50 cellog Exp $ */ /** * Intermediate class parsing structure. @@ -43,7 +43,7 @@ * @package phpDocumentor * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: Classes.inc,v 1.5 2006/02/23 15:09:18 cellog Exp $ + * @version $Id: Classes.inc,v 1.6 2006/02/26 02:39:50 cellog Exp $ */ class Classes { @@ -1030,6 +1030,12 @@ } } else { + if (class_exists('ReflectionClass') && class_exists($ex)) { + $r = new ReflectionClass($ex); + if ($r->isInternal()) { + return $ex; // no warning + } + } addWarning(PDERROR_PARENT_NOT_FOUND, $class, $ex); return $ex; } http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/Converter.inc?r1=1.12&r2=1.13&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Converter.inc diff -u pear/PhpDocumentor/phpDocumentor/Converter.inc:1.12 pear/PhpDocumentor/phpDocumentor/Converter.inc:1.13 --- pear/PhpDocumentor/phpDocumentor/Converter.inc:1.12 Sat Feb 25 03:12:42 2006 +++ pear/PhpDocumentor/phpDocumentor/Converter.inc Sun Feb 26 02:39:50 2006 @@ -22,7 +22,7 @@ * @package Converters * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: Converter.inc,v 1.12 2006/02/25 03:12:42 cellog Exp $ + * @version $Id: Converter.inc,v 1.13 2006/02/26 02:39:50 cellog Exp $ */ /** * Smarty template files @@ -56,7 +56,7 @@ * @abstract * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: Converter.inc,v 1.12 2006/02/25 03:12:42 cellog Exp $ + * @version $Id: Converter.inc,v 1.13 2006/02/26 02:39:50 cellog Exp $ */ class Converter { @@ -4608,7 +4608,9 @@ $ovr = $element->getOverrides($this); if (!$ovr) return false; $sdesc = $ovr->docblock->getSDesc($this); - return array('link' => $ovr->getLink($this),'sdesc' => $sdesc); + $name = method_exists($ovr, 'getFunctionCall') ? $ovr->getFunctionCall() : $ovr->getName(); + $link = ($link = $ovr->getLink($this)) ? $link : $ovr->getClass() . '::' . $name; + return array('link' => $link,'sdesc' => $sdesc); } /** @@ -4647,7 +4649,7 @@ * * uses parserVar helper function getInheritedVars and generates a * template-enabled list using getClassLink() - * @param parserVar $child class method + * @param parserVar $child class var * @see getClassLink(), parserVar::getInheritedVars() * @return array Format: * <pre> @@ -4676,22 +4678,31 @@ $file = $vars['file']; $vars = $vars['vars']; $par = $this->classes->getClass($parent,$file); - $package = $par->docblock->package; + if ($par) { + $package = $par->docblock->package; + } usort($vars,array($this,"sortVar")); - $result['parent_class'] = $this->getClassLink($parent,$package); + $result['parent_class'] = $this->getClassLink($parent, $package); + if (!$result['parent_class']) { + $result['parent_class'] = $parent . ' (Internal Class)'; + } foreach($vars as $var) { $info = array(); - if ($var->docblock->hasaccess) - $info['access'] = $var->docblock->tags['access'][0]->value; - else - $info['access'] = 'public'; + if ($var->docblock->hasaccess) { + $info['access'] = $var->docblock->tags['access'][0]->value; + } else { + $info['access'] = 'public'; + } - $info['abstract'] = isset ($var->docblock->tags['abstract'][0]); + $info['abstract'] = isset ($var->docblock->tags['abstract'][0]); - $info['name'] = $var->getName(); + $info['name'] = $var->getName(); $info['link'] = $var->getLink($this); + if (!$info['link']) { + $info['link'] = $info['name']; + } $info['default'] = $this->postProcess($var->getValue()); if ($var->docblock) $info['sdesc'] = $var->docblock->getSDesc($this); @@ -4738,22 +4749,30 @@ $file = $methods['file']; $methods = $methods['methods']; $par = $this->classes->getClass($parent,$file); - $package = $par->docblock->package; + if ($par) { + $package = $par->docblock->package; + } usort($methods,array($this,"sortMethod")); $result['parent_class'] = $this->getClassLink($parent,$package); + if (!$result['parent_class']) { + $result['parent_class'] = $parent . ' (Internal Class)'; + } foreach($methods as $method) { $info = array(); - if ($method->docblock->hasaccess) - $info['access'] = $method->docblock->tags['access'][0]->value; - else - $info['access'] = 'public'; - - $info['abstract'] = isset ($method->docblock->tags['abstract'][0]); + if ($method->docblock->hasaccess) { + $info['access'] = $method->docblock->tags['access'][0]->value; + } else { + $info['access'] = 'public'; + } + $info['abstract'] = isset ($method->docblock->tags['abstract'][0]); - if ($method->isConstructor) $info['constructor'] = 1; + if ($method->isConstructor) $info['constructor'] = 1; $info['link'] = $method->getLink($this); + if (!$info['link']) { + $info['link'] = $method->getFunctionCall(); + } $info['name'] = $method->getName(); if ($method->docblock) $info['sdesc'] = $method->docblock->getSDesc($this); @@ -4808,20 +4827,28 @@ $file = $vars['file']; $vars = $vars['consts']; $par = $this->classes->getClass($parent,$file); - $package = $par->docblock->package; + if ($par) { + $package = $par->docblock->package; + } usort($vars,array($this,"sortVar")); $result['parent_class'] = $this->getClassLink($parent,$package); + if (!$result['parent_class']) { + $result['parent_class'] = $parent . ' (Internal Class)'; + } foreach($vars as $var) { $info = array(); - if ($var->docblock->hasaccess) + if ($var->docblock->hasaccess) { $info['access'] = $var->docblock->tags['access'][0]->value; - else + } else { $info['access'] = 'public'; - + } $info['name'] = $var->getName(); $info['link'] = $var->getLink($this); + if (!$info['link']) { + $info['link'] = $info['name'] . ' = ' . $var->getValue(); + } $info['value'] = $this->postProcess($var->getValue()); if ($var->docblock) $info['sdesc'] = $var->docblock->getSDesc($this); http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/ParserElements.inc?r1=1.3&r2=1.4&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/ParserElements.inc diff -u pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.3 pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.4 --- pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.3 Thu Feb 23 05:48:30 2006 +++ pear/PhpDocumentor/phpDocumentor/ParserElements.inc Sun Feb 26 02:39:50 2006 @@ -22,7 +22,7 @@ * @package phpDocumentor * @subpackage ParserElements * @since 1.1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ /** @@ -32,7 +32,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserElement extends parserBase { @@ -185,7 +185,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserInclude extends parserElement { @@ -201,7 +201,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserGlobal extends parserElement { @@ -304,7 +304,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserFunction extends parserElement { @@ -659,7 +659,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserClass extends parserElement { @@ -1008,7 +1008,7 @@ */ function getInheritedMethods(&$c,$override = false) { - $x = $this; + $x = $oldx = $this; $methods = array(); $arr = array(); while ($x->parent && is_array($x->parent)) @@ -1043,8 +1043,59 @@ $arr[$par->getName()]['file'] = $par->curfile; } } + $oldx = $x; $x = &$par; } + if (is_a($oldx, 'parserClass') && is_a($oldx->getExtends(true), 'ReflectionClass')) { + $extends = $oldx->getExtends(true); + foreach ($extends->getMethods() as $method) { + $var = new parserMethod($oldx->getExtends()); + if ($method->returnsReference()) { + $var->setReturnsReference(); + } + $doc = new parserDocBlock; + foreach ($method->getParameters() as $param) { + $value = $param->isDefaultValueAvailable() ? var_export($param->getDefaultValue(), true) : null; + if ($param->isPassedByReference()) { + $var->addParam('&$' . $param->getName(), $value, $param->isOptional(), + $param->getClass()); + } else { + $var->addParam('$' . $param->getName(), $value, $param->isOptional(), + $param->getClass()); + } + } + $var->setName($method->getName()); + $doc->addPackage('package', $oldx->getPackage()); + $var->setDocBlock($doc); + $par = $method->getDeclaringClass(); + $var->setLineNumber($par->getStartLine()); + $modifiers = array(); + if ($method->isPrivate()) { + $modifiers[] = 'private'; + } + if ($method->isAbstract()) { + $modifiers[] = 'abstract'; + } + if ($method->isFinal()) { + $modifiers[] = 'final'; + } + if ($method->isProtected()) { + $modifiers[] = 'protected'; + } + if ($method->isPublic()) { + $modifiers[] = 'public'; + } + if ($method->isStatic()) { + $modifiers[] = 'static'; + } + if ($method->isConstructor()) { + $var->setConstructor(); + } + $var->setModifiers($modifiers); + $arr[$oldx->getExtends()]['methods'][] = $var; + $arr[$oldx->getExtends()]['file'] = '(internal)'; + } + } return $arr; } @@ -1055,7 +1106,7 @@ */ function getInheritedVars(&$c,$override = true, $vars = false) { - $x = $this; + $x = $oldx = $this; $vars = array(); $arr = array(); while ($x->parent && is_array($x->parent)) @@ -1090,8 +1141,37 @@ $arr[$par->getName()]['file'] = $par->curfile; } } + $oldx = $x; $x = &$par; } + if (is_a($oldx, 'parserClass') && is_a($oldx->getExtends(true), 'ReflectionClass')) { + $extends = $oldx->getExtends(true); + foreach ($extends->getProperties() as $property) { + $var = new parserVar($oldx->getExtends()); + $doc = new parserDocBlock; + $var->setName('$' . $property->getName()); + $doc->addPackage('package', $oldx->getPackage()); + $par = $property->getDeclaringClass(); + $var->setLineNumber($par->getStartLine()); + $modifiers = array(); + if ($property->isPrivate()) { + $modifiers[] = 'private'; + $doc->addAccess('private'); + } + if ($property->isProtected()) { + $modifiers[] = 'protected'; + $doc->addAccess('protected'); + } + if ($property->isPublic()) { + $modifiers[] = 'public'; + $doc->addAccess('public'); + } + $var->setDocBlock($doc); + $var->setModifiers($modifiers); + $arr[$oldx->getExtends()]['vars'][] = $var; + $arr[$oldx->getExtends()]['file'] = '(internal)'; + } + } return $arr; } @@ -1102,7 +1182,7 @@ */ function getInheritedConsts(&$c,$override = false, $consts = false) { - $x = $this; + $x = $oldx = $this; $consts = array(); $arr = array(); while ($x->parent && is_array($x->parent)) @@ -1137,8 +1217,26 @@ $arr[$par->getName()]['file'] = $par->curfile; } } + $oldx = $x; $x = &$par; } + if (is_a($oldx, 'parserClass') && is_a($oldx->getExtends(true), 'ReflectionClass')) { + $extends = $oldx->getExtends(true); + if (!$extends->getConstants()) { + return $arr; + } + foreach ($extends->getConstants() as $property => $value) { + $var = new parserConst($oldx->getExtends()); + $doc = new parserDocBlock; + $var->setName($property); + $var->setValue(var_export($value, true)); + $doc->addPackage('package', $oldx->getPackage()); + $var->setLineNumber($extends->getStartLine()); + $var->setDocBlock($doc); + $arr[$oldx->getExtends()]['consts'][] = $var; + $arr[$oldx->getExtends()]['file'] = '(internal)'; + } + } return $arr; } @@ -1221,6 +1319,15 @@ function setExtends($extends) { $this->extends = $extends; + if (!class_exists('ReflectionClass') || !class_exists($extends)) { + return; + } + // this may throw an exception. Hopefully it won't if the class exists + $parent = new ReflectionClass($extends); + if (!$parent->isInternal()) { + return; + } + $this->extends = $parent; } /** @@ -1243,9 +1350,14 @@ * @return boolean * @see $extends */ - function getExtends() + function getExtends($raw = false) { if (!isset($this->extends)) return false; + if (!$raw) { + if (is_a($this->extends, 'ReflectionClass')) { + return $this->extends->getName(); + } + } return $this->extends; } } @@ -1255,7 +1367,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserVar extends parserElement { @@ -1328,15 +1440,50 @@ $class = $c->classes->getClass($this->class,$this->path); $par = $class->getParent($c); + if (!is_object($par)) { + if (is_a($class->getExtends(true), 'ReflectionClass')) { + $pare = $class->getExtends(true); + if ($pare->hasProperty(substr($this->name, 1))) { + $par = $pare; + $property = $par->getProperty(substr($this->name, 1)); + $ret = new parserVar($par->getName()); + $doc = new parserDocBlock; + $ret->setName('$' . $property->getName()); + $doc->addPackage('package', $class->getPackage()); + $ret->setLineNumber($par->getStartLine()); + $modifiers = array(); + if ($property->isPrivate()) { + if ($c->parseprivate) { + return false; + } + $modifiers[] = 'private'; + $doc->addAccess('private'); + } + if ($property->isProtected()) { + $modifiers[] = 'protected'; + $doc->addAccess('protected'); + } + if ($property->isPublic()) { + $modifiers[] = 'public'; + $doc->addAccess('public'); + } + $ret->setDocBlock($doc); + $ret->setModifiers($modifiers); + return $ret; + } + } + } while (is_object($par)) { - if ($par->hasVar($c,$this->name)) - { - $var = $par->getVar($c,$this->name); - if (!($var->docblock && $var->docblock->hasaccess && !$c->parseprivate && $var->docblock->tags['access'][0]->value == 'private')) - return $var; - } - $par = $par->getParent($c); + if ($par->hasVar($c,$this->name)) + { + $var = $par->getVar($c,$this->name); + if (!($var->docblock && $var->docblock->hasaccess && + !$c->parseprivate && $var->docblock->tags['access'][0]->value == 'private')) { + return $var; + } + } + $par = $par->getParent($c); } return false; @@ -1432,7 +1579,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserMethod extends parserFunction { @@ -1528,17 +1675,79 @@ $class = $c->classes->getClass($this->class,$this->path); $par = $class->getParent($c); - + if (!is_object($par)) { + if (is_a($class->getExtends(true), 'ReflectionClass')) { + $pare = $class->getExtends(true); + if ($pare->hasMethod($this->name)) { + $par = $pare; + $method = $par->getMethod($this->name); + $var = new parserMethod($par->getName()); + if ($method->returnsReference()) { + $var->setReturnsReference(); + } + $doc = new parserDocBlock; + foreach ($method->getParameters() as $param) { + $value = $param->isOptional() ? var_export($param->getDefaultValue(), true) : null; + if ($param->isPassedByReference()) { + $var->addParam('&$' . $param->getName(), $value, $param->isOptional(), + $param->getClass()); + } else { + $var->addParam('$' . $param->getName(), $value, $param->isOptional(), + $param->getClass()); + } + } + $var->setName($method->getName()); + $doc->addPackage('package', $this->getPackage()); + $par = $method->getDeclaringClass(); + $var->setLineNumber($par->getStartLine()); + $modifiers = array(); + if ($method->isPrivate()) { + $modifiers[] = 'private'; + $doc->addAccess('private'); + } + $blank = new parserStringWithInlineTags; + if ($method->isAbstract()) { + $modifiers[] = 'abstract'; + $doc->addKeyword('abstract', $blank); + } + if ($method->isFinal()) { + $modifiers[] = 'final'; + $doc->addKeyword('final', $blank); + } + if ($method->isProtected()) { + $modifiers[] = 'protected'; + $doc->addAccess('protected'); + } + if ($method->isPublic()) { + $modifiers[] = 'public'; + $doc->addAccess('public'); + } + if ($method->isStatic()) { + $modifiers[] = 'static'; + $doc->addKeyword('static', $blank); + } + if ($method->isConstructor()) { + $var->setConstructor(); + } + $var->setDocBlock($doc); + $var->setModifiers($modifiers); + return $var; + } + } + } + while (is_object($par)) { - if ($par->hasMethod($c,$this->name)) - { - $meth = $par->getMethod($c,$this->name); - if (!($meth->docblock && $meth->docblock->hasaccess && !$c->parseprivate && $meth->docblock->tags['access'][0]->value == 'private')) - return $meth; - } - - $par = $par->getParent($c); + if ($par->hasMethod($c,$this->name)) + { + $meth = $par->getMethod($c,$this->name); + if (!($meth->docblock && $meth->docblock->hasaccess && + !$c->parseprivate && $meth->docblock->tags['access'][0]->value == 'private')) { + return $meth; + } + } + + $par = $par->getParent($c); } return false; @@ -1616,7 +1825,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserDefine extends parserElement { @@ -1660,7 +1869,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.4 2006/02/26 02:39:50 cellog Exp $ */ class parserPackagePage extends parserStringWithInlineTags { http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/scripts/create_package.xml.php?r1=1.28&r2=1.29&diff_format=u Index: pear/PhpDocumentor/scripts/create_package.xml.php diff -u pear/PhpDocumentor/scripts/create_package.xml.php:1.28 pear/PhpDocumentor/scripts/create_package.xml.php:1.29 --- pear/PhpDocumentor/scripts/create_package.xml.php:1.28 Sat Feb 25 04:53:09 2006 +++ pear/PhpDocumentor/scripts/create_package.xml.php Sun Feb 26 02:39:50 2006 @@ -16,7 +16,8 @@ Features added to this release include: * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2 - language constructs. Note that you must be running phpDocumentor in + language constructs. Internal classes are recognized and inheritance is + documented. Note that you must be running phpDocumentor in PHP 5 in order to parse PHP 5 code * XML:DocBook/peardoc2:default converter now beautifies the source using PEAR\'s XML_Beautifier if available @@ -70,6 +71,7 @@ [ not entered ] XMLDocBookpeardoc2 beautifier removes comments [ 893186 ] HTMLframes converter sometimes misses package level docs [ 896444 ] Bad line numbers + [ 907734 ] Exception Class is builtin to PHP5 [ 937235 ] duplicated /** after abstract method declaration [ 944149 ] Apostrophe in DocBook name breaks DOM/earthli tree index [ 952217 ] HTML:frames:earthli @@ -175,7 +177,7 @@ $pfm2->setReleaseVersion($version); $pfm2->setNotes($notes); $pfm2->clearDeps(); -$pfm2->setPhpDep('4.1.0'); +$pfm2->setPhpDep('4.2.0'); $pfm2->setPearinstallerDep('1.4.6'); $pfm2->addPackageDepWithChannel('optional', 'XML_Beautifier', 'pear.php.net', '1.1'); $pfm2->addReplacement('pear-phpdoc', 'pear-config', '@PHP-BIN@', 'php_bin');
« previous php.pear.cvs (#38625) next »