[TYPO3-v4] TYPO3 4.6 and PHP 5.3
Xavier Perseguers
xavier at typo3.org
Wed Jun 29 07:04:49 CEST 2011
Hi all,
We now have a dependency to PHP 5.3 for TYPO3 4.6 but still, one of the
basic features of PHP 5.3 used by FLOW3 is namespaces [1].
FLOW3 is currently reviewing a change to support vendor namespaces [2]
thus making the "F3" namespace obsolete:
\RobertLemke\AutoMakeTemplate\Controller\FooController
\Zend\...
\TYPO3\FLOW3\Package\PackageManagerInterface
\TYPO3\TYPO3\Domain\Model\Site
Currently we have pseudo namespaces with our class naming prefix (I take
the Extbase variant with camel case):
"Tx_" extension_key "_" directory [ "_" directory ... ] "_" class_name
Example:
extbase/Classes/MVC/Controller/ActionController.php gives
Tx_Extbase_MVC_Controller_ActionController
Without discussing here how it should be named CGL-wised, the purpose of
adding namespace support for 4.6 is to be able to name it e.g.,
\TYPO3\Extbase\MVC\Controller\ActionController
and instantiate it with
/** @var $actionController \TYPO3\Extbase\MVC\Controller\ActionController */
$actionController =
t3lib_div::makeInstance('\TYPO3\Extbase\MVC\Controller\ActionController');
I created a task for this 3 months ago [3] and I'd like to push it a bit
before feature freeze. Anybody interested?
If new to namespaces, the FAQ entry on how a name is resolved when using
a backslash at the beginning or not is worth reading [4].
Cheers
Xavier
[1] http://www.php.net/manual/en/language.namespaces.rationale.php
[2] http://forge.typo3.org/issues/27490
[3] http://forge.typo3.org/issues/25337
[4]
http://www.php.net/manual/en/language.namespaces.faq.php#language.namespaces.faq.full
--
Xavier Perseguers
Release Manager TYPO3 4.6
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-project-v4
mailing list