After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642468 - PHP 5.3 namespaces
PHP 5.3 namespaces
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: documentation
1.7.3
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2011-02-16 15:23 UTC by Georg Andrew
Modified: 2011-08-14 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase, config file and results for 3 versions (175.41 KB, application/x-gzip)
2011-03-01 11:28 UTC, Nicolas Briche
  Details
Patch to support PHP namespace with curly braces (833 bytes, patch)
2011-04-04 18:01 UTC, Dimitri van Heesch
none Details | Review

Description Georg Andrew 2011-02-16 15:23:18 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
Comment 1 Nicolas Briche 2011-02-25 19:50:26 UTC
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...
Comment 2 Dimitri van Heesch 2011-02-26 14:50:32 UTC
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?
Comment 3 Georg Andrew 2011-02-27 22:11:12 UTC
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)
Comment 4 Nicolas Briche 2011-03-01 11:28:19 UTC
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.
Comment 5 Samu Voutilainen 2011-04-04 13:26:16 UTC
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.
Comment 6 Dimitri van Heesch 2011-04-04 18:01:56 UTC
Created attachment 185129 [details] [review]
Patch to support PHP namespace with curly braces

Proposed patch against 1.7.4. Feedback is welcome.
Comment 7 Dimitri van Heesch 2011-04-04 18:03:39 UTC
(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.
Comment 8 Nicolas Briche 2011-04-05 08:01:24 UTC
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!
Comment 9 Samu Voutilainen 2011-04-06 11:48:23 UTC
(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!
Comment 10 Dimitri van Heesch 2011-08-14 14:05:03 UTC
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.