Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in GlobalConfig with hhvm #225

Closed
Yogu opened this issue May 25, 2015 · 4 comments
Closed

Error in GlobalConfig with hhvm #225

Yogu opened this issue May 25, 2015 · 4 comments

Comments

@Yogu
Copy link

Yogu commented May 25, 2015

Running phpdox with hhvm 3.7.0 causes the following exception:

 [exec] PHP Version: 5.6.99-hhvm (Linux)
 [exec] PHPDox Version: 841d7fd-dirty
 [exec] ErrorException: E_WARNING 
 [exec] Location: /var/lib/jenkins/workspace/project/vendor/theseer/phpdox/src/config/GlobalConfig.php (Line 85)
 [exec] 
 [exec] DOMElement::getAttribute() expects exactly 1 parameter, 2 given
 [exec] 
 [exec] #0 /var/lib/jenkins/workspace/project/vendor/theseer/phpdox/src/config/GlobalConfig.php(85): DOMElement->getAttribute()
 [exec] #1 /var/lib/jenkins/workspace/project/vendor/theseer/phpdox/src/CLI.php(96): TheSeer\phpDox\GlobalConfig->isSilentMode()
 [exec] #2 /var/lib/jenkins/workspace/project/vendor/theseer/phpdox/composer/bin/phpdox(30): TheSeer\phpDox\CLI->run()

The xpath evaluate function somehow returns a DOMElement instead of a fDOMElement. It's probably either a bug in hhvm or in fDOMDocument.

This workaround might be relevant, but I think the underlying bug has been fixed in hhvm.

With zend's php5, it works fine.

If you need more information, e.g. configuration files, I'll gladly provide them.

@theseer
Copy link
Owner

theseer commented May 27, 2015

I'd say, that is a bug in hhvm: The DOMNodelist returned by the xpath' evaluate() method is supposed to contain references to the node instances of the DOMDocument they belong to and thus should be of fDOM* type as registered.

I don't really see a clean way to implement a workaround (other than hacks) since DOMNodelist cannot really be instantiated in userland nor manipulated.

We should open a new issue for hhvm though.

@theseer
Copy link
Owner

theseer commented May 27, 2015

Opened an issue for hhvm: facebook/hhvm#5412

@theseer
Copy link
Owner

theseer commented May 27, 2015

Based on feedback for the hhvm issue, I implemented a workaround into fDOMDocument. With 1.6.1 it works for me again:

theseer@nyda ~/storage/php/phpdox master $ hhvm -d hhvm.libxml.ext_entity_whitelist=file phpdox
phpDox 0.8.0-10-g7975765-dirty - Copyright (C) 2010 - 2015 by Arne Blankerts

[27.05.2015 - 23:07:13] Using config file './phpdox.xml.dist'
[27.05.2015 - 23:07:13] Registered collector backend 'parser'
[27.05.2015 - 23:07:13] Registered enricher 'build'
[27.05.2015 - 23:07:13] Registered enricher 'git'
[27.05.2015 - 23:07:13] Registered enricher 'checkstyle'
[27.05.2015 - 23:07:13] Registered enricher 'phpcs'
[27.05.2015 - 23:07:13] Registered enricher 'pmd'
[27.05.2015 - 23:07:13] Registered enricher 'phpunit'
[27.05.2015 - 23:07:13] Registered enricher 'phploc'
[27.05.2015 - 23:07:13] Registered output engine 'xml'
[27.05.2015 - 23:07:13] Registered output engine 'html'
[27.05.2015 - 23:07:14] Starting to process project 'phpDox'
[27.05.2015 - 23:07:14] Starting collector
[27.05.2015 - 23:07:14] Scanning directory '/home/theseer/storage/php/phpdox/src' for files to process

..................................................  [50]
[...]
.                                                   [201]

[27.05.2015 - 23:07:17] Saving results to directory '/home/theseer/storage/php/phpdox/build/api/xml'
[27.05.2015 - 23:07:18] Resolving inheritance

..................................................  [50]
[...]
..........                                          [210]

[27.05.2015 - 23:07:18] The following unit(s) had missing dependencies during inheritance resolution:
[27.05.2015 - 23:07:18]  - TheSeer\phpDox\Collector\Backend\CustomLexer (missing PhpParser\Lexer\Emulative)
[27.05.2015 - 23:07:18]  - TheSeer\phpDox\Collector\Backend\UnitCollectingVisitor (missing PhpParser\NodeVisitorAbstract)
[27.05.2015 - 23:07:18] Collector process completed

[27.05.2015 - 23:07:18] Starting generator
[27.05.2015 - 23:07:18] Loading enrichers
[27.05.2015 - 23:07:18] Enricher Build Information initialized successfully
[27.05.2015 - 23:07:18] Enricher GIT information initialized successfully
[27.05.2015 - 23:07:18] Enricher CheckStyle XML initialized successfully
[27.05.2015 - 23:07:18] Enricher PHPMessDetector XML initialized successfully
[27.05.2015 - 23:07:19] Enricher PHPLoc xml initialized successfully
[27.05.2015 - 23:07:19] Enricher PHPUnit Coverage XML initialized successfully
[27.05.2015 - 23:07:19] Starting event loop.

..................................................  [50]
[..]
............................................        [2094]

[27.05.2015 - 23:07:34] Generator process completed
[27.05.2015 - 23:07:34] Processing project 'phpDox' completed.


Time: 20.73 seconds, Memory: 227.08Mb

@Yogu
Copy link
Author

Yogu commented Jun 12, 2015

Thanks for reporting the hhvm issue and providing this workaround. It works for me, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants