[TYPO3-50-general] Will Typo3 5.0 use namespaces with PHP 5.3/PHP 6?

Malte Jansen mail at maltejansen.de
Sun Jan 13 20:03:17 CET 2008


Hi Christoph,

Christoph Blömer schrieb:
> Hello,
> 
> will Typo3 5.0 use namespaces from PHP 5.3 and PHP 6 instead of the long 
> class names with prefixes?

PHP6 is not used, because the PHP6-Core Team has moved the release date 
to "unknown" release-date. To late for TYPO3 5.0. But there are some 
class providing function of PHP6.

Check out http://5-0.dev.typo3.org/.

> 
> Instead of:
> 
> class T3_PhoneBookTutorial_View_PhoneBookEntries {
> }
> 
> you could use:
> 
> namespace T3::PhoneBookTutorial::View;
> class PhoneBookEntries {
> }

Robert said something about it.
So I'm relativly sure namespaces will be used, but until now you cannot 
use them. (I think the whole project will be refactored)

> 
> If you want to use this class you can import it:
> 
> require 'T3/PhoneBookTutorial/View/PhoneBookEntries.php';
You don't need required anymore. Classes are autoloaded.

> import T3::PhoneBookTutorial::View;
> new PhoneBookEntries();

Normally you are not allowed to use the "new". For creating objects you 
have to use the ComponentManager. Pretty cool thing. The CM is already 
implemented. With the you can manage different Version of the same Class 
etc.

But better wait for an answer of Robert or Karten ;)

Cheers,

Malte


More information about the TYPO3-project-5_0-general mailing list