Bug #14640 [Asn]: class witch extending DOMDocument

From: Date: Wed, 23 Sep 2009 23:02:24 +0000
Subject: Bug #14640 [Asn]: class witch extending DOMDocument
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-1712@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=14640&edit=1 ID: 14640 Updated by: demon.gene@gmail.com Reported By: j dot siska at sprocomp dot cz Summary: class witch extending DOMDocument Status: Assigned Type: Bug Package: PhpDocumentor Operating System: Win32 Package Version: 1.4.2 PHP Version: 5.2.6 Assigned To: ashnazg Roadmap Versions: New Comment: Thanks Maarten, that was exactly what I needed... I've opened PHP bug #49647 regarding DOMUserData's non-existence in the DOM extension's code. I will look at adding a workaround in phpDocumentor that will recognize this condition and declare a dummy DOMUserData class when it's needed. Previous Comments: ------------------------------------------------------------------------ [2009-09-17 16:45:48] maarten I've done some searching and have come to the conclusion that the problem is that the method DOMNode::getUserData() is not implemented in the DOM-extension, but is prototyped. See ext/dom/node.c, line 1735 at revision 1.72 in the php source. The prototype mentions DomUserData as the class for the second argument 'data', but that class doesn't exist in PHP. The ReflectionClass will look for it and throw an error. Workaround is to define a dummy class DomUserData to prevent this error. On my system I've added the following line somewhere in the top of phpDocumentor/phpDocumentor/ParserElements.inc: class DomUserData { } and this successfully prevents the error. ------------------------------------------------------------------------ [2009-08-12 16:58:47] ashnazg Note to self: check ext/dom... ------------------------------------------------------------------------ [2009-08-08 09:20:53] ashnazg -Status: Open +Status: Assigned -Assigned To: +Assigned To: ashnazg I can duplicate this issue with both of the provided test classes, when using Ubuntu 9.04's provided PHP 5.2.6. However, it works perfectly with all my compiled PHP installations on the same box (5.3.0, 5.2.10, 5.1.6, 5.0.5, 4.4.9). This hints to me that it's some kind of issue with what is compiled into PHP or what extensions are available via php.ini. ------------------------------------------------------------------------ [2009-07-21 17:36:19] ashnazg -Roadmap Versions: +Roadmap Versions: 1.4.3 ------------------------------------------------------------------------ [2008-12-05 03:57:02] drx777 I can confirm that for Linux, PHP 5.2.6-2ubuntu4 with Suhosin-Patch 0.9.6.2 (cli) Simpler test case: ------------------ <?php class test extends DOMElement { } ?> Error output: ------------- Converting /var/www/test.php Procedural Page Elements... Classes... ReflectionException: Class DOMUserData does not exist in /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/ParserElements.inc on line 1106 Call Stack: 0,0105 62112 1. {main}() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpdoc:0 0,0294 75616 2. include('/var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/phpdoc.inc') /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpdoc:59 0,3427 9555100 3. phpDocumentor_setup->createDocs() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/phpdoc.inc:65 0,3479 9583624 4. phpDocumentor_IntermediateParser->Output() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Setup.inc.php:754 0,4030 9695880 5. phpDocumentor_IntermediateParser->Convert() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/IntermediateParser.inc:1865 0,4030 9695880 6. Converter->walk() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/IntermediateParser.inc:1652 0,5197 9760380 7. Converter->Convert() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Converter.inc:1934 0,5197 9760380 8. HTMLframesConverter->convertClass() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Converter.inc:3983 0,5197 9760380 9. Converter->convertClass() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Converters/HTML/frames/HTMLframesConverter.inc:1032 0,5205 9770472 10. Converter->getFormattedInheritedMethods() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Converter.inc:4075 0,5206 9770544 11. parserClass->getInheritedMethods() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/Converter.inc:4911 0,5303 9952216 12. ReflectionParameter->getClass() /var/www/PhpDocumentor-1.4.2/PhpDocumentor-1.4.2/phpDocumentor/ParserElements.inc:1106 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=14640 -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=14640&edit=1

« previous php.pear.bugs (#1712) next »