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

phpdox breaks on windows #144

Closed
jnfingerle opened this issue May 6, 2014 · 7 comments
Closed

phpdox breaks on windows #144

jnfingerle opened this issue May 6, 2014 · 7 comments

Comments

@jnfingerle
Copy link

Hi,

phpdox breaks with the following log under Windows.

C:\Users\user.name\Zend\workspaces\DefaultWorkspace10\Rahmen>phpdox
phpDox 0.6.6 - Copyright (C) 2010 - 2014 by Arne Blankerts

[06.05.2014 - 18:46:19] Using config file './phpdox.xml'
[06.05.2014 - 18:46:19] Registered enricher 'build'
[06.05.2014 - 18:46:19] Registered enricher 'git'
[06.05.2014 - 18:46:19] Registered enricher 'checkstyle'
[06.05.2014 - 18:46:19] Registered enricher 'pmd'
[06.05.2014 - 18:46:19] Registered enricher 'phpunit'
[06.05.2014 - 18:46:19] Registered enricher 'phploc'
[06.05.2014 - 18:46:19] Registered output engine 'xml'
[06.05.2014 - 18:46:19] Registered output engine 'html'
[06.05.2014 - 18:46:19] Starting to process project 'name-of-project'
[06.05.2014 - 18:46:19] Starting collector
[06.05.2014 - 18:46:19] Scanning directory 'src' for files to process

cccccccccccccccc [16]

[06.05.2014 - 18:46:19] Saving results to directory 'build/phpdox'
[06.05.2014 - 18:46:19] Collector process completed

[06.05.2014 - 18:46:19] Starting generator
[06.05.2014 - 18:46:19] Loading enrichers
[06.05.2014 - 18:46:19] Starting event loop.

....

Oups... phpDox encountered a problem and has terminated!

It most likely means you've found a bug, so please file a report for this
and paste the following details and the stacktrace (if given) along:

PHP Version: 5.5.7 (WINNT)
PHPDox Version: 0.6.6
Exception: TheSeer\fXSL\fXSLTProcessorException (Code: 2)
Location: phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/
PHAR/phpDox/phpDox-0.6.6.phar/fXSL-1.0.4/TheSeer/fXSL/fxsltprocessor.php (Line 2
51)

Error while importing given stylesheet

[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity
"phar%3A/C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/p
hpDox/phpDox-0.6.6.phar/templates/html/components.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//C%3
A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/phpDox
-0.6.6.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl li
ne 8 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/
C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/php
Dox-0.6.6.phar/templates/html/components.xsl
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity
"phar%3A/C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/p
hpDox/phpDox-0.6.6.phar/templates/html/functions.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//C%3
A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/phpDox
-0.6.6.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl li
ne 9 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/
C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/php
Dox-0.6.6.phar/templates/html/functions.xsl
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity
"phar%3A/C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/p
hpDox/phpDox-0.6.6.phar/templates/html/synopsis.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//C%3
A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/phpDox
-0.6.6.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl li
ne 10 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/
C%3A/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/phpDox/php
Dox-0.6.6.phar/templates/html/synopsis.xsl
#0 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/generator/engine/html/Html.php(171): TheSeer\fXSL
fXSLTProcessor->transformToDoc()
#1 unknown(0): TheSeer\phpDox\Generator\Engine\Html->buildClass()
#2 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/generator/Generator.php(179): call_user_func()
#3 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/generator/Generator.php(253): TheSeer\phpDox\Gener
ator\Generator->handleEvent()
#4 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/generator/Generator.php(225): TheSeer\phpDox\Gener
ator\Generator->processClass()
#5 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/generator/Generator.php(137): TheSeer\phpDox\Gener
ator\Generator->processWithNamespace()
#6 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/Application.php(238): TheSeer\phpDox\Generator\Gen
erator->run()
#7 phar://C:/Users/user.name/Zend/workspaces/DefaultWorkspace10/TOOLS/PHAR/ph

pDox/phpDox-0.6.6.phar/phpdox/CLI.php(152): TheSeer\phpDox\Application->runGener
ator()
#8 C:\Users\user.name\Zend\workspaces\DefaultWorkspace10\TOOLS\PHAR\phpDox\ph

pDox-0.6.6.phar(547): TheSeer\phpDox\CLI->run()

@theseer
Copy link
Owner

theseer commented May 6, 2014

Can you verify if this actually a duplicate of #112 or maybe even #105?

Windows seems to have a hard time working with phar streams when used with fully qualified paths. So far I failed to find a real fix or workaround for that. The phar%3A/C%3A/ is looking wired, though i have no idea why PHP on Windows seems to cause this.

@jnfingerle
Copy link
Author

It looks like it's related to #112 and #105, but I don't have the means to confirm that this is really a duplicate or degression, maybe it's a new problem only somehow conntected to those.

The problem appears with absolute paths and with relative paths to the phar file.

@theseer
Copy link
Owner

theseer commented May 8, 2014

My last point was not about the path to the phar itself but access to files within the phar.
It seems that PHP on Windows has issues dealing with paths like phar://file.phar/path/in/phar/file.ext - in relation to xsl at least.

I'll have to spent more time on this.

@MartinHolland
Copy link

@theseer Did you manage to get anywhere with this one?

@theseer
Copy link
Owner

theseer commented Nov 15, 2014

Using a phar build from the latest source code, I don't have any issues on windows 7 anymore, as the following terminal output shows:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\TheSeer\Desktop\phpdox>c:\PHP\php.exe c:\PHP\phpdox.phar
phpDox 0.7.0-42-g96bc460 - Copyright (C) 2010 - 2014 by Arne Blankerts

[15.11.2014 - 00:55:46] Using config file './phpdox.xml.dist'
[15.11.2014 - 00:55:46] Registered collector backend 'parser'
[15.11.2014 - 00:55:46] Registered enricher 'build'
[15.11.2014 - 00:55:46] Registered enricher 'git'
[15.11.2014 - 00:55:46] Registered enricher 'checkstyle'
[15.11.2014 - 00:55:46] Registered enricher 'phpcs'
[15.11.2014 - 00:55:46] Registered enricher 'pmd'
[15.11.2014 - 00:55:46] Registered enricher 'phpunit'
[15.11.2014 - 00:55:46] Registered enricher 'phploc'
[15.11.2014 - 00:55:46] Registered output engine 'xml'
[15.11.2014 - 00:55:46] Registered output engine 'html'
[15.11.2014 - 00:55:46] Starting to process project 'phpDox'
[15.11.2014 - 00:55:46] Starting collector
[15.11.2014 - 00:55:46] Scanning directory 'src' for files to process

..................................................      [50]
..................................................      [100]
..................................................      [150]
.........                                               [159]

[15.11.2014 - 00:55:48] Saving results to directory 'C:/Users/TheSeer/Desktop/phpdox/build/api/xml'
[15.11.2014 - 00:55:49] Resolving inheritance

..................................................      [50]
..................................................      [100]
..................................................      [150]
............................                            [178]

[15.11.2014 - 00:55:49] The following unit(s) had missing dependencies during inheritance resolution:
[15.11.2014 - 00:55:49]  - TheSeer\phpDox\Collector\Backend\OriginalValueLexer (missing PHPParser_Lexer_Emulative)
[15.11.2014 - 00:55:49]  - TheSeer\phpDox\Collector\Backend\UnitCollectingVisitor (missing PHPParser_NodeVisitorAbstract)
[15.11.2014 - 00:55:49] Collector process completed

[15.11.2014 - 00:55:49] Starting generator
[15.11.2014 - 00:55:49] Loading enrichers
[15.11.2014 - 00:55:49] Enricher Build Information initialized successfully
[15.11.2014 - 00:55:49] Enricher GIT information initialized successfully
[15.11.2014 - 00:55:49] Exception while initializing enricher checkstyle:

    Logfile "C:/Users/TheSeer/Desktop/phpdox/build/logs/checkstyle.xml" not found.

[15.11.2014 - 00:55:49] Exception while initializing enricher pmd:

    Logfile "C:/Users/TheSeer/Desktop/phpdox/build/logs/pmd.xml" not found.

[15.11.2014 - 00:55:49] Exception while initializing enricher phploc:

    PHPLoc xml file "C:/Users/TheSeer/Desktop/phpdox/build/logs/phploc.xml" not found.

[15.11.2014 - 00:55:49] Starting event loop.

..................................................      [50]
..................................................      [100]
..................................................      [150]
..................................................      [200]
..................................................      [250]
..................................................      [300]
..................................................      [350]
..................................................      [400]
..................................................      [450]
..................................................      [500]
..................................................      [550]
..................................................      [600]
..................................................      [650]
..................................................      [700]
..................................................      [750]
..................................................      [800]
..................................................      [850]
..................................................      [900]
..................................................      [950]
..................................................      [1000]
..................................................      [1050]
..................................................      [1100]
..................................................      [1150]
..................................................      [1200]
..................................................      [1250]
..................................................      [1300]
..................................................      [1350]
..................................................      [1400]
..................................................      [1450]
..................................................      [1500]
..................................................      [1550]
..................................................      [1600]
..................................................      [1650]
......................                                  [1672]

[15.11.2014 - 00:56:04] Generator process completed
[15.11.2014 - 00:56:04] Processing project 'phpDox' completed.


Time: 17.4 seconds, Memory: 10.00Mb

System information:

C:\Users\TheSeer\Desktop\phpdox>c:\PHP\php.exe -v
PHP 5.5.4 (cli) (built: Sep 18 2013 13:06:07)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
LibXML Version 2.9.1
LibXSLT 1.1.27

Since I don't really use windows, can anyone verify on other windows boxes?

@eidng8
Copy link

eidng8 commented Dec 12, 2014

Build always fail here on Windows 7 x64

phpDox 0.7.0 - Copyright (C) 2010 - 2014 by Arne Blankerts

[12.12.2014 - 09:11:48] Using config file './phpdox.xml'
[12.12.2014 - 09:11:48] Registered collector backend 'parser'
[12.12.2014 - 09:11:48] Registered enricher 'build'
[12.12.2014 - 09:11:48] Registered enricher 'git'
[12.12.2014 - 09:11:48] Registered enricher 'checkstyle'
[12.12.2014 - 09:11:48] Registered enricher 'phpcs'
[12.12.2014 - 09:11:48] Registered enricher 'pmd'
[12.12.2014 - 09:11:48] Registered enricher 'phpunit'
[12.12.2014 - 09:11:48] Registered enricher 'phploc'
[12.12.2014 - 09:11:48] Registered output engine 'xml'
[12.12.2014 - 09:11:48] Registered output engine 'html'
[12.12.2014 - 09:11:48] Starting to process project 'Money'
[12.12.2014 - 09:11:48] Starting collector
[12.12.2014 - 09:11:48] Scanning directory '../src/php' for files to process

..                                                      [2]

[12.12.2014 - 09:11:48] Saving results to directory 'phpdox'
[12.12.2014 - 09:11:48] Resolving inheritance

.                                                       [1]

[12.12.2014 - 09:11:48] Collector process completed

[12.12.2014 - 09:11:48] Starting generator
[12.12.2014 - 09:11:48] Loading enrichers
[12.12.2014 - 09:11:48] Enricher Build Information initialized successfully
[12.12.2014 - 09:11:48] Enricher GIT information initialized successfully
[12.12.2014 - 09:11:48] Enricher PHPLoc xml initialized successfully
[12.12.2014 - 09:11:48] Enricher CheckStyle XML initialized successfully
[12.12.2014 - 09:11:48] Enricher PHPMessDetector XML initialized successfully
[12.12.2014 - 09:11:48] Enricher PHPUnit Coverage XML initialized successfully
[12.12.2014 - 09:11:48] Starting event loop.

....

Oups... phpDox encountered a problem and has terminated!

It most likely means you've found a bug, so please file a report for this
and paste the following details and the stacktrace (if given) along:

PHP Version: 5.5.12 (WINNT)
PHPDox Version: 0.7.0
Exception: TheSeer\fXSL\fXSLTProcessorException (Code: 2)
Location: phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/fXSL-1.0.4/TheSeer/fXSL/fxsltprocessor.php (Line 251)

Error while importing given stylesheet

[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity "phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/components.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl lin
e 8 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/components.xsl
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity "phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/functions.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl lin
e 9 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/functions.xsl
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity "phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/synopsis.xsl"
[XML-STRING] [Line: 0 - Column: 0] Error 1: compilation error: file phar%3A//D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/engine/html/../../../../templates/html/class.xsl lin
e 10 element import
[XML-STRING] [Line: 0 - Column: 0] Error 1: xsl:import : unable to load phar%3A/D%3A/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/templates/html/synopsis.xsl


#0 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/engine/html/Html.php(208): TheSeer\fXSL\fXSLTProcessor->transformToDoc()
#1 unknown(0): TheSeer\phpDox\Generator\Engine\Html->buildClass()
#2 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/Generator.php(203): call_user_func()
#3 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/Generator.php(277): TheSeer\phpDox\Generator\Generator->handleEvent()
#4 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/Generator.php(249): TheSeer\phpDox\Generator\Generator->processClass()
#5 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/generator/Generator.php(142): TheSeer\phpDox\Generator\Generator->processWithNamespace()
#6 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/Application.php(238): TheSeer\phpDox\Generator\Generator->run()
#7 phar://D:/Research/Web/3rdPartyAPI/build/tools/phpdox.phar/phpdox/CLI.php(152): TheSeer\phpDox\Application->runGenerator()
#8 D:\Research\Web\3rdPartyAPI\build\tools\phpdox.phar(460): TheSeer\phpDox\CLI->run()

@theseer
Copy link
Owner

theseer commented Apr 22, 2015

Current versions of master seem to work fine on windows 7 at least in my Test-VM.
I consider this issue closed. If this problem re-appears, please open a new issue.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\TheSeer\Desktop\phpdox\tests\data\issue212>c:\php\php.exe ..\..\..\phpdox.phar -f ./test.xml
phpDox 0.7.0-126-g7feacfa - Copyright (C) 2010 - 2015 by Arne Blankerts

[21.04.2015 - 03:54:56] Using config file './test.xml'
[21.04.2015 - 03:54:56] Registered collector backend 'parser'
[21.04.2015 - 03:54:56] Registered enricher 'build'
[21.04.2015 - 03:54:56] Registered enricher 'git'
[21.04.2015 - 03:54:56] Registered enricher 'checkstyle'
[21.04.2015 - 03:54:56] Registered enricher 'phpcs'
[21.04.2015 - 03:54:56] Registered enricher 'pmd'
[21.04.2015 - 03:54:56] Registered enricher 'phpunit'
[21.04.2015 - 03:54:56] Registered enricher 'phploc'
[21.04.2015 - 03:54:56] Registered output engine 'xml'
[21.04.2015 - 03:54:56] Registered output engine 'html'
[21.04.2015 - 03:54:56] Starting to process project 'phpDox-issue212'
[21.04.2015 - 03:54:56] Starting collector
[21.04.2015 - 03:54:56] Scanning directory 'C:/Users/TheSeer/Desktop/phpdox/tests/data/issue212/src' for files to process

...                                                     [3]

[21.04.2015 - 03:54:56] Saving results to directory 'C:/Users/TheSeer/Desktop/phpdox/tests/data/issue212/xml'
[21.04.2015 - 03:54:56] Resolving inheritance

...                                                     [3]

[21.04.2015 - 03:54:56] Collector process completed

[21.04.2015 - 03:54:56] Starting generator
[21.04.2015 - 03:54:56] Loading enrichers
[21.04.2015 - 03:54:56] Enricher Build Information initialized successfully
[21.04.2015 - 03:54:56] Starting event loop.

...........................                             [27]

[21.04.2015 - 03:54:57] Generator process completed
[21.04.2015 - 03:54:57] Processing project 'phpDox-issue212' completed.


Time: 297 ms, Memory: 5.00Mb

@theseer theseer closed this as completed Apr 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants