Edit report at http://bugs.php.net/bug.php?id=52504&edit=1

 ID:                 52504
 Comment by:         giorgio dot liscio at email dot it
 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:

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...


Previous Comments:
------------------------------------------------------------------------
[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

Reply via email to