Bug 255537 - Incomplete PHP namespace support
Summary: Incomplete PHP namespace support
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: 4.1.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 325985 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-28 21:44 UTC by Jan Buchar
Modified: 2018-05-28 17:53 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Buchar 2010-10-28 21:44:28 UTC
Version:           4.1.0 (using KDE 4.5.2) 
OS:                Linux

Current PHP namespace support is restricted to
- Specifying the working namespace with the 'namespace' keyword
- Accessing classes etc. contained in namespaces by specifying the namespace (not by fully qualified path)

Features that are still missing are
- Accessing classes etc. by their fully qualified paths (starting with '\' - starting in the "global" namespace, eg. \Foo\Bar) - therefore attempts to access a class contained in a namespace while in another namespace are considered syntax errors (See http://www.php.net/manual/en/language.namespaces.global.php)
- The use statement support (See https://bugs.kde.org/show_bug.cgi?id=244040, http://php.net/manual/en/language.namespaces.importing.php)

Reproducible: Always
Comment 1 Milian Wolff 2010-10-28 21:54:05 UTC
very true, I really have to fix this up and improve the halfbaked situation I shipped with 4.1 :-S

bye
Comment 2 zidagartsk 2013-09-26 15:52:44 UTC
Some news?

On Debian Sid with kdevelop-php 1.5.1-1 I've problem with namespace and not fully qualified path.

Thanks :)
Comment 3 Heinz Wiesinger 2014-01-19 10:54:55 UTC
*** Bug 325985 has been marked as a duplicate of this bug. ***
Comment 4 Heinz Wiesinger 2014-01-20 15:35:38 UTC
Git commit 853286ec7c3004fc55628c10e05f1c5a5522db53 by Heinz Wiesinger.
Committed on 23/09/2013 at 17:21.
Pushed by wiesinger into branch 'master'.

Handle global variables in namespaces correctly.

PHP does not support namespaced variables. Variable declarations
inside a namespace are just global declarations.
REVIEW: 115117

M  +6    -0    duchain/builders/declarationbuilder.cpp
M  +25   -13   duchain/expressionvisitor.cpp
M  +2    -1    duchain/expressionvisitor.h
M  +42   -1    duchain/tests/uses.cpp
M  +3    -0    duchain/tests/uses.h

http://commits.kde.org/kdev-php/853286ec7c3004fc55628c10e05f1c5a5522db53
Comment 5 Heinz Wiesinger 2014-01-20 18:52:03 UTC
Git commit 536a3a186bd937642095fd99079e24a2a98939c7 by Heinz Wiesinger.
Committed on 19/01/2014 at 16:21.
Pushed by wiesinger into branch 'master'.

Fix support for PHP namespaces.

Make sure use declarations actually find their original declarations
and implement lookup for definitions within the same namespace but
in a different file.
Also handle name conflicts.
Related: bug 244040
REVIEW: 115158

M  +34   -9    duchain/builders/declarationbuilder.cpp
M  +110  -62   duchain/helper.cpp
M  +9    -0    duchain/helper.h
M  +11   -0    duchain/tests/expressionparser.cpp
M  +1    -0    duchain/tests/expressionparser.h
M  +26   -15   duchain/tests/uses.cpp

http://commits.kde.org/kdev-php/536a3a186bd937642095fd99079e24a2a98939c7
Comment 6 Alexander Zhigalin 2018-05-28 17:53:21 UTC
The namespaces support seems to be pretty stable at the moment
so I'm closing this