Req #52504 [Com]: Support relative namespaces

From: Date: Wed, 18 Aug 2010 13:44:12 +0000
Subject: Req #52504 [Com]: Support relative namespaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153569@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52504&edit=1 ID: 52504 Comment by: robert dot de dot wilde at online dot nl Reported by: robert dot de dot wilde at online dot nl Summary: Support relative namespaces Status: Open Type: Feature/Change Request Package: *Programming Data Structures Operating System: Any PHP Version: 5.3.3 Block user comment: N New Comment: Any developer can have a look? Previous Comments: ------------------------------------------------------------------------ [2010-07-31 10:54:14] giorgio dot liscio at email dot it very nice, i really like it it would be nice too having * on import works only if __autoload or spl_autoload_register is used, otherwise triggers an error use MyNS\Test\*; // imports all classes in the "Test" namespace use MyNS\Test\**; // imports all the namespace hierarchy (including subpackages) from namespace Test __autoload($className, $importAll = FALSE, $importDeep = FALSE) { // handle * as a full dir import // ** imports subdirs too } in my framework i need to put use \FW\String; use \FW\Int; use \FW\Float; use \FW\Vector; use \FW\Dictionary; use \FW\Types; etc in every file... ------------------------------------------------------------------------ [2010-07-31 09:58:03] robert dot de dot wilde at online dot nl Description: ------------ It would be nice to have relative namespace support to keep code clean and flexible. When inside of a namespace, it would be nice to have some directory-path-like option like '..'. Test script: --------------- namespace MyNs\Some\Path\Going\A\Long\Way { class GoClass extends ..\..\Short\Way\GoClass // << {} } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52504&edit=1

« previous php.bugs (#153569) next »