Bug #14640 [Com]: class witch extending DOMDocument
| From: | maarten | Date: | Thu, 17 Sep 2009 15:46:34 +0000 |
| Subject: | Bug #14640 [Com]: class witch extending DOMDocument | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-1664@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
Comment by: maarten
Reported By: maarten at vivesta dot com
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
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2009-08-12 16:58:47] ashnazg
Note to self: check ext/dom...
------------------------------------------------------------------------
[2009-08-08 09:20:53] ashnazg
<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Assigned</span>
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: ashnazg</span>
</div>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
<div id="changeset">
<span class="removed">-Roadmap Versions:</span>
<span class="added">+Roadmap Versions: 1.4.3</span>
</div>
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2008-09-12 02:34:41] xsiska
Description:
------------
PhpDocumentator is failing to make documentation in file witch has code
with class that is extending DOMDocument.
eg.
class fcomp extends DOMDocument{
/**
* constructor
*
*/
function __construct() {
pasrent::__construct();
}
}
Test script:
---------------
<?
class fcomp extends DOMDocument{
/**
* Constructor
*
*/
function __construct() {
pasrent::__construct();
}
}
?>
Expected result:
----------------
success
Actual result:
--------------
Parsing Files ...
PHP Version 5.2.6
phpDocumentor version 1.4.1
Parsing configuration file phpDocumentor.ini...
(found in C:/apache2triad/htdocs/phpdoc/)...
done
Maximum memory usage set at 256M after considering php.ini...
using tokenizer Parser
Grabbing README/INSTALL/CHANGELOG
done
Tutorial/Extended Documentation Parsing Stage
done
General Parsing Stage
Reading file C:/apache2triad/htdocs/lukas/ReeGOSystem/a.php -- Parsing
file
WARNING in a.php on line 1: no @package tag was used in a DocBlock for
class fcomp
WARNING in a.php on line 10: File
"C:\apache2triad\htdocs\lukas\ReeGOSystem\a.php" has no page-level
DocBlock, use @package in the first DocBlock to create one
done
Converting From Abstract Parsed Data
Processing Class Inheritance
Processing Root Trees
Processing leftover classes (classes that extend root classes not found
in the same package)
Processing fcomp in file
C:\apache2triad\htdocs\lukas\ReeGOSystem\a.php
done processing leftover classes
Processing Procedural Page Element Name Conflicts
Sorting page elements...done
Formatting @uses list...done
creating C:\apache2triad\htdocs\lukas\ReeGOSystem/\media
copying C:\apache2triad\htdocs\lukas\ReeGOSystem/\media/background.png
copying C:\apache2triad\htdocs\lukas\ReeGOSystem/\media/empty.png
copying C:\apache2triad\htdocs\lukas\ReeGOSystem/\media/style.css
Building indexes...done
Sorting Indexes...done
Sorting @todo list...done
Converting tutorials/extended docs
Formatting Package Indexes... Writing
C:\apache2triad\htdocs\lukas\ReeGOSystem/elementindex_default.html
done
Formatting Index...
Writing C:\apache2triad\htdocs\lukas\ReeGOSystem/elementindex.html
Writing C:\apache2triad\htdocs\lukas\ReeGOSystem/li_default.html
Writing C:\apache2triad\htdocs\lukas\ReeGOSystem/index.html
done
Formatting Left Quick Index...
Writing
C:\apache2triad\htdocs\lukas\ReeGOSystem/classtrees_default.html
done
Converting C:\apache2triad\htdocs\lukas\ReeGOSystem\a.php Procedural
Page Elements... Classes...
Fatal error: Uncaught exception 'ReflectionException' with message
'Class DOMUserData does not exist' in
C:\apache2triad\htdocs\phpdoc\phpDocumentor\ParserElements.inc:1106
Stack trace:
#0
C:\apache2triad\htdocs\phpdoc\phpDocumentor\ParserElements.inc(1106):
ReflectionParameter->getClass()
#1 C:\apache2triad\htdocs\phpdoc\phpDocumentor\Converter.inc(4911):
parserClass->getInheritedMethods(Object(HTMLSmartyConverter))
#2 C:\apache2triad\htdocs\phpdoc\phpDocumentor\Converter.inc(4075):
Converter->getFormattedInheritedMethods(Object(parserClass))
#3
C:\apache2triad\htdocs\phpdoc\phpDocumentor\Converters\HTML\Smarty\HTMLSmartyConverter.inc(1080):
Converter->convertClass(Object(parserClass))
#4 C:\apache2triad\htdocs\phpdoc\phpDocumentor\Converter.inc(3983):
HTMLSmartyConverter->convertClass(Object(parserClass))
#5 C:\apache2triad\htdocs\phpdoc\phpDocumentor\Converter.inc(1934):
Converter->Convert(Object(parserClass))
#6
C:\apache2triad\htdocs\phpdoc\phpDocumentor\IntermediateParser.inc(1652):
Converter->walk(Array, Array)
#7 in C:\apache2triad\htdocs\phpdoc\phpDocumentor\ParserElements.inc
on line 1106
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=14640&edit=1