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

Bug #12361 missing links to the filesource
Submitted: 2007-10-30 17:00 UTC
From: cwiedmann Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.0)
PHP Version: 5.2.4 OS: Windows_NT
Roadmaps: 1.4.2    
Subscription  


 [2007-10-30 17:00 UTC] cwiedmann (Carsten Wiedmann)
Description: ------------ Hello, if I use @filesource, there are no links from the line numbers to the filesource. If I remove @filesource and use the "-s on" parameter, I have this link. (with @filesource and "-s on" also no link) Regards, Carsten Test script: --------------- <?php /** * @package Test * * @filesource */ /** * Description * * @package Test */ class Test { /** * Test() * * @return void * @access public */ function Test() { } } ?> Expected result: ---------------- Constructor Test (line 21) --^ The number "21" should be a link to line 21 in the filesource. Actual result: -------------- Constructor Test (line 21) --^ The number "21" is not a link.

Comments

 [2007-12-09 02:27 UTC] ashnazg (Chuck Burgess)
I'd bet this differing behavior is due to @filesource only being used in page-level docblocks (and therefore _not_ having any effect on documentation of elements like class/var/method), whereas "-s on" means _all_ sourcecode is captured and therefore it is safe for the element docs to assume links from its line numbers will indeed have a file to point to.
 [2007-12-15 02:09 UTC] ashnazg (Chuck Burgess)
Testing this myself, and I'm having no problem. Tried on v1.4.0 and on new v1.4.1, using PHP v5.2.5 on Linux. The only way I can _not_ have line numbers, is to have _neither_ "@filesource" nor "-s on". If I have "@filesource", then "-s" makes no difference either way... I _do_ have linked line numbers in the output. If I don't use "@filesource", then "-s off" leaves me no linked line numbers, whereas "-s on" does give me links. So, I cannot duplicate this problem. I'll have to try specifically on WinXP to see if it's OS specific.
 [2007-12-15 02:32 UTC] ashnazg (Chuck Burgess)
I can indeed duplicate this on WinXP, using v1.4.1 on PHP v5.2.5. So, this issue is specific to Windows.
 [2007-12-15 02:40 UTC] ashnazg (Chuck Burgess)
Tested this on Mac OS X, v1.4.1 with PHP v4.4.7, and everything works just as perfectly as it does for me on Linux. I've therefore isolated this bug behavior to Windows, and confirmed it still exists in PhpDoc v1.4.1.
 [2007-12-18 18:01 UTC] ashnazg (Chuck Burgess)
Monitoring the getSourceAnchor() method in the HTMLSmartyConverter class, I see the different behavior between Windows and Linux... I don't see the method being called on Windows at all, whereas on Linux it is being called and is producing the line number hyperlink.
 [2007-12-18 22:25 UTC] ashnazg (Chuck Burgess)
Eventually found a path comparison check that was using a forward-slashed path to compare to a backslashed path, on Windows at least. The Converter patch fixes that. I also found a logic error in the setPath() method of the parserElement class, so the other patch fixes it. This error did not affect this bug, as per my testing, but was an obvious error nonetheless. I want to test these patches tonight on my Mac (PHP4 on OS X) to be sure they work fine there, as well as doing my larger regression testing.
 [2007-12-19 02:17 UTC] ashnazg (Chuck Burgess)
Regression tests are ok. Patches committed to CVS.