Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Bug #12172 media files are not being copied
Submitted: 2007-10-02 17:14 UTC
From: n3rdnl Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.0)
PHP Version: 5.2.4 OS: windows xp
Roadmaps: 1.4.1    

 [2007-10-02 17:14 UTC] n3rdnl (Boaz Besten)
Description: ------------ I have installed PhpDocumentor as an external tool in eclipse PDT. (Like on this page is done for PHPeclipse: But when I run the script it says "done" but after the I get errors. It turns out it has something to do with a "edia" directory, it also created a "edia" directory in the target directory instead of a "media" directory. I even tried to run PhpDocumentor directly from the commandline. Then i get no error messages but it still doesn't work. Test script: --------------- D:\Server\php5\php.exe "D:\Server\PhpDocumentor-1.4.0\phpDocumentor\" -t D:\Server\htdocs\eclipsePDT-workspace\framework\doc -d D:\Server\htdocs\eclipsePDT-workspace\framework\ -o HTML:Smarty:PHP Actual result: -------------- * an 'edia' directory is created (instead of 'media') * The following 3 errors are displayd: PHP Warning: copy(D:/Server/PhpDocumentor-1.4.0/phpDocumentor/Converters/HTML/Smarty/templates/PHP/templates/edia/background.png): failed to open stream: No such file or directory in D:\Server\PhpDocumentor-1.4.0\phpDocumentor\ on line 5328 PHP Warning: copy(D:/Server/PhpDocumentor-1.4.0/phpDocumentor/Converters/HTML/Smarty/templates/PHP/templates/edia/empty.png): failed to open stream: No such file or directory in D:\Server\PhpDocumentor-1.4.0\phpDocumentor\ on line 5328 PHP Warning: copy(D:/Server/PhpDocumentor-1.4.0/phpDocumentor/Converters/HTML/Smarty/templates/PHP/templates/edia/style.css): failed to open stream: No such file or directory in D:\Server\PhpDocumentor-1.4.0\phpDocumentor\ on line 5328


 [2007-10-14 13:19 UTC] nemesis (Martin Visser)
Seems to be in /phpDocumentor/ line 543: $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($base_dir)))+1); should be $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($base_dir))));
 [2007-11-17 18:40 UTC] jorrit (Jorrit Schippers)
This could be some Windows issue ... I have it on Windows XP as well.
 [2007-11-25 20:47 UTC] sharedlog (Dmitri Snytkine)
I agree this is a bug, I also had the same exact error on windows XP. I changed the code on line 543 as suggested by nemesis and it fixed the problem. Also I think for windows the path should be using backslash instead of forward slash. It still worked with forward slash on Windows XP but really, on windows the paths are always using back slash.
 [2007-12-05 21:39 UTC] ashnazg (Chuck Burgess)
Finally had a chance to load PhpDocumentor back on Windows and test this... I can duplicate the problem on v1.4.0, and the indicated fix does solve the problem. What I was never able to do was duplicate the problem at all on Linux. I still need to see if the fix has any effect at all on Linux, as well as run tests on OS X.
 [2007-12-06 01:28 UTC] ashnazg (Chuck Burgess)
Using this patch on Linux (PHP 5.2.5) and OS X (PHP 4.4.7) both result in the "media" directory name being recorded by that changed line 543 to instead be "/media", which results in this error later in the method: Notice: Undefined index: / in /path/to/PhpDocumentor/phpDocumentor/ on line 599 This does not seem to prevent the media subdirectory from being created and populated though. I need to retest on Windows to see if this notice occurs there too.
 [2007-12-06 02:56 UTC] ashnazg (Chuck Burgess)
No, I don't see the notice occur on Windows... probably due to the patch _fixing_ the algorithm to derive "media" rather than "edia". It looks like this one changed line will need a conditional around it to only drop the "+1" on Windows.
 [2007-12-07 03:25 UTC] ashnazg (Chuck Burgess)
Dropping the "+1" only on Windows, while leaving it intact for non-Windows, tests good on Windows, Mac, and Ubuntu. Uploading patch...
 [2007-12-07 03:31 UTC] ashnazg (Chuck Burgess)
Committed patch to CVS.