7

I was trying to run phpdox on windows server 2012 - but I am getting the error:

PHP Version: 7.0.5 (WINNT)
PHPDox Version: 0.8.1.1
Exception: TheSeer\phpDox\Generator\TokenFileException (Code: 1)
Location: phar://D:/htdocs/AscPro/bin/phpdox-0.8.1.1.phar/phpdox/generator/pro
ject/TokenFile.php (Line 19)

File 'file:/D:/htdocs/AscPro/build/phpdox/tokens/AppBundle/AppBundle.php.xml'
not found

I've checked the location, the file is not missing. I'm running into this problem during continuous integration process with jenkins. It is very strange, because the same phpdox version did work for me on ubuntu. Maybe this is related to the fact, that all programs lay on "C:", including Jenkins - but the jenkins workspace lays on "D:"?

user3746259
  • 1,491
  • 2
  • 23
  • 46

2 Answers2

1

I think that the problem lies within incorrect using WINDOWS path. Please see this question:

Help with windows path - PHP

As a quick test, try to change file_exists check to harcoded argument:

file:///C:\htdocs\AscPro\build\phpdox\tokens\AppBundle\AppBundle.php.xml

Community
  • 1
  • 1
Jehy
  • 4,729
  • 1
  • 38
  • 55
0

Im afraid it`s a bug of phpdox.

Phpdox convert all paths to unix style before check to exists.

You can see this code here.

Maybe you can hack function exists

replace: return file_exists($this->getPathname());

to: return file_exists(parent::getPathname());

whitediver
  • 462
  • 3
  • 12
  • Is there no workaround? Can I override the fileinfo class of the bundle somehow? Or are there any equivalent tools that generate docs like phpdox and work on windows Server? – user3746259 May 04 '16 at 19:43
  • Add how to hack exist function. Comments formatting is so poor. – whitediver May 05 '16 at 07:50
  • Can't agree, as `file_exists` with `/` works same on Unix and Windows with exception of directory names, but this is not a directory related case. – yergo May 11 '16 at 11:10
  • Thats my conclusion too, but I still could not find an answer on why phpdox is not working on windows – user3746259 May 17 '16 at 08:43