[TYPO3-dev] A question about namespaces

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Mar 18 17:02:46 CET 2013


Dmitry Dulepov schrieb am 18.03.2013 15:29:
> Hi!
> 
> François Suter wrote:
>> Consider one of my extensions, "external_import", and let's say that I
>> use my company's name (Cobweb) as a vendor name. Namespaced classes in
>> my extension would then be something like:
>>
>> \Cobweb\ExternalImport\Foo\Bar
> 
> Shouldn't it be in CGL? Currently I use
> TYPO3\CMS\Extension\<CompanyName>\<ExtensionKey>\blahblah. That looks
> the most logical to me because it shows that it is an extension, which
> is a part of TYPO3 CMS made by a certain company. Since I have
> namespaced classes, which are not TYPO3-related, I avoid conflicts with
> my scheme.

Although it makes sense, the wiki page documenting the Namespace use in
TYPO3 CMS (Core) [1] states that this is not allowed:

* The TYPO3 core uses \TYPO3\CMS as vendor name. As a extension
developer you are not allowed to use this vendor in your own extension!
Instaed, use your company name. Until now there is no vendor
registration like it was there for extension keys, so ensure to pick a
unique vendor name. Your vendor must have only one part for now, not two
as the core vendor. Valid vendor names for extensions could be \Enet or
\DKD for example. Please check the web/github quickly to ensure
uniqueness. Domain and brand names are also good vendor names (without
dots and tlds).

* The second part of the namespace (in case of core classes the third
part) is treated as the extension key. Pick an extension key to your
liking, thanks to the unique vendor name collisions with other
extensions will not happen. The extension key part in the namespace have
to be written in UpperCamelCase and is internally transformed to
lowercase_underscore.

To me a proper identification of this package as being a "TYPO3 CMS
Extension" is missing. I.e. if I implement a "blog" as a TYPO3 CMS
Extension *and* and as a TYPO3 Flow Package, how would I differentiate
them both?

Regards,
Ernesto



[1] http://wiki.typo3.org/Namespaces




More information about the TYPO3-dev mailing list