[TYPO3-core] RFC: #11438: Add a registry to t3lib

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Aug 10 17:17:43 CEST 2009


Ingo Renner schrieb:

>> instead of having people use a standard syntax for the $key. Then glue
>> them together in the code to keep the rest of the code as is.
>>
>> Extbase and pibase could have a "wrapper" function without $namespace,
>> which could then add the current extension key as a namespace, for
>> example.
> 
> but honestly, what sense would that double work make?
> The namespacing as it is "enforced" now is exactly waht you want
> already. If you want to get a namespace, just split after the first ".".
> I really don't get all the fuzz about the overly complicated
> namespacing. It's enforced already, why should it require an additional
> argument then? To me that is overengineering a very simple thing.

It seems "overengineered" right now. If this is a required strucuted
information, why not require it as a separate argument in the first
place? Why handle this with a separate Exception?

Compare your:

	/**
	 * Sets a persistent entry.
	 *
	 * @param	string	The key of the entry to set. Must be namespaced by
prepending the key with the extension key for extensions or 'core' for
core registry entries. Example: tx_myext.my.entry
	 * @param	mixed	The value to set. This can be any PHP data type; this
class takes care of serialization as necessary.
	 * @throws	InvalidArgumentException	Throws an exception if the entry
key is not prefixed with a namespace
	 */
	public function set($key, $value) {

with:

	/**
	 * Sets a persistent entry.
	 *
	 * @param	string	Namespace. extension key for extensions or 'core' for
core registry entries
	 * @param	string	The key of the entry to set.
	 * @param	mixed	The value to set. This can be any PHP data type; this
class takes care of serialization as necessary.
	 */
	public function set($namespace, $key, $value) {


Which one seems more "overengineered"?

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list