[TYPO3-core] RFC: #11438: Add a registry to t3lib
Bastian Waidelich
bastian at typo3.org
Tue Aug 11 13:46:38 CEST 2009
Ries van Twisk wrote:
Hi Ries,
> in fact you can even add two functions to PiBase to give any extension
> proper access to the registry in that case
Yes, that's what I thought too. And an equivalent could be added to
extbase too, as Ernesto suggested.
> function getRegister($key);
> function setRegister($key, $value);
maybe rather
getFromRegistry($key) and storeInRegistry($key, $value)
or
getRegistryValue($key) and setRegistryValue($key, $value)
to avoid confusion..
> About namespaces and object usage, I personally like this method better:
> $myRegister = new t3lib_Registry('tx_my_name-space');
Yes, you're right - that would be an option too.
Only disadvantage I can see ATM:
t3lib_Registry could not be a singleton anymore. If you'd want to use
the registry in several places with the same namespace (e.g. "core") you
would need to load the same keys multiple times..
Bastian
More information about the TYPO3-team-core
mailing list