Author Topic: PHP namespace emulation and support  (Read 3176 times)

cylab

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
PHP namespace emulation and support
« on: January 08, 2008, 01:59:40 am »
I would really like to see both namespace emulation (for PHP <6) and namespace support for the upcoming PHP 6. The problem is that when i put PHP classes with the same name but in different packages they're named the same globally, meaning that I have no idea which one to choose when selecting argument types etc. Due to the lack of namespaces in PHP <6 the PHP community found its own way of emulating these, and http://framework.zend.com/manual/en/coding-standard.naming-conventions.html#coding-standard.naming-conventions.classes is probably one of the most popular naming conventions. I believe that it wouldn't be a problem to implement this, as it's more or less like C++ namespaces, but with the "::" replaced with "_".

I'm in the trial period right now, but with this fixed I'm 100% sure that I will buy your software (EA), as it seems to be the best one available.

Thanks
Lukas Kalinski
Sweden

thomaskilian

  • Guest
Re: PHP namespace emulation and support
« Reply #1 on: January 12, 2008, 08:18:04 am »
The code gen can be changed by the user as it is macro driven. I haven't tried this, but I'm quite sure you can change that with not much effort.

cylab

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: PHP namespace emulation and support
« Reply #2 on: January 12, 2008, 08:36:06 am »
Quote
The code gen can be changed by the user as it is macro driven. I haven't tried this, but I'm quite sure you can change that with not much effort.


Yes, I've tried that and unfortunately the %packagePath% macro won't display the complete package path - it only displays the root package name. Changing language to Java will make it work as expected though. Further, what I requested wasn't only the code generation part, but also in EA, while editing operations and attributes (for example), it would be nice to not just see two "Person" types, as it's impossible to know which one is which, but somehow see their package/namespace path.