GNOME Bugzilla – Bug 642468
PHP 5.3 namespaces
Last modified: 2011-08-14 14:05:03 UTC
Hello Dimitri Thank you for the work you've done on doxygen, it's a great tool. My question concerns PHP 5.3> namespaces, I do not know if it's a bug or a missing feature. If I use bracketed namespaces, then doxygen does not document the code. I can only see the namespace in the list, but functions/classes are not documented. On the other hand, non bracketed namespaces work fine, or at least what I managed to test so far. Here's a small example (without the documentation tags): 1. This one would be documented just fine (non bracketed namespace, where the namespace is defined at the start, as a simple line) namespace Test; class RandomClass {...} 2. This one would not (bracketed namespace, where inside code is wrapped around "{}" ) namespace Test { class RandomClass { ... } } Best wishes
This also happens to me, starting with v1.7.2. Up to 1.7.1, test #1 wouldn't work, while #2 would work. Starting with 1.7.2 (including current SVN), #1 works, but #2 doesn't anymore. I have too many classes written with the bracket syntax to switch them right now, so I'm kind of stuck with 1.7.1 for the time being...
Can one of you please attach a self-contained example (source+config file in a tar or zip) that allows me to reproduce the problem with doxygen 1.7.3?
Hello Dimitri You can checkout the project I'm currently working on from github: https://github.com/pixelplant/ZeroG There's also a file called "zerog.cfg" in the root, for doxygen (1.7.3)
Created attachment 182171 [details] testcase, config file and results for 3 versions Hello, Here's the simplest case I could do: 2 files, one namespace per file. One namespace is defined using brackets, the other using a one-liner. Each namespace contains the same class (class Test, having one member $test). The Doxyfile is a prod file, except the output path and language. I've included the HTML results for 1.7.1 (Ubuntu Maverick official package), 1.7.2 (from SVN r745), current SVN. For all results, both namespaces are listed in namespaces.html. But: For html-1.7.1, Test1 is populated, Test2 is not. For html-1.7.2 and html-svn, Test2 is populated, Test1 is not.
This is really annoying... Confirming the behaviour. And since pre 1.7.4 versions don’t support namespaces even that well, Doxygen is almost useless for namespaced PHP applications at the moment :( IMHO this is bug, and for PHP quite serious one.
Created attachment 185129 [details] [review] Patch to support PHP namespace with curly braces Proposed patch against 1.7.4. Feedback is welcome.
(In reply to comment #5) > This is really annoying... Confirming the behaviour. And since pre 1.7.4 > versions don’t support namespaces even that well, Doxygen is almost useless for > namespaced PHP applications at the moment :( > > IMHO this is bug, and for PHP quite serious one. Instead of complaining you can also help fixing. Anyway, please try the patch and let me know if it works.
Review of attachment 185129 [details] [review]: Works against the testcase I've made in Comment #4. Also tested against a current project, using a namespace defined by multiple files with both syntaxes. Also works. Thanks!
(In reply to comment #7) > (In reply to comment #5) > > This is really annoying... Confirming the behaviour. And since pre 1.7.4 > > versions don’t support namespaces even that well, Doxygen is almost useless for > > namespaced PHP applications at the moment :( > > > > IMHO this is bug, and for PHP quite serious one. > > Instead of complaining you can also help fixing. > Anyway, please try the patch and let me know if it works. Sorry, I didn’t mean to be offensive, I just thought this wasn’t classified as a bug... I tested the patch and it fixed the problem, many thanks!
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.5. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.