[TYPO3-dev] Determine which table belongs to with extension key
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Mon Jan 29 10:53:55 CET 2007
Am Mon, 29 Jan 2007 10:25:59 +0100 schrieb Oliver Hader:
> Hi,
>
> is there a function that tells me the extension key of a table?
> e.g. table "tx_myextension_data" -> "my_extension"
>
> Thanks in advance for any hints!
>
>
> olly
Hi Olly,
as long as the table names keep the rules, the whole extension key is in
the second part of the name:
tx_myextension_data could be my_extension.
So what do you need to do? Compare the second part to each member of the
list $TYPO3_CONF_VARS[EXT]. You need to strip the underscores of the keeys
for comparism. Then you have the key.
The comparism itself should be secure. Nobody can register
"mysuper_extension" if "my_superextension" is already registered. I have
provided in a patch for TER to prohibit such "double" registrations. As
far as I know Robert has implemented it.
Regards
Elmar
More information about the TYPO3-dev
mailing list