[TYPO3-core] RFC: #11438: Add a registry to t3lib
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon Aug 10 16:39:14 CEST 2009
Ingo Renner schrieb:
(...)
>> That would make it easier to e.g. display all values of one extension.
>
> That could still be done with a method like Olly proposed,
> getByNamespace(). That would then just run through all keys and check
> whether they start with the requested namespace. (Would be bad
> performance wise though)
>
>> And then I second Olivers remark "is it required to have everything from
>> the registry table loaded?"
>
> See my reply to Olly, IMO it simplifies the thing a lot. If we see that
> people put all kinds of stuff into it and bloat up the registry, we
> could still do something about it IMO.
>
>> Maybe it's a good idea to load all values of a namespace as soon as it's
>> accessed the first time?
>
> Lazy loading might be an option then, but that would also require
> consecutive queries after the initial (and for now only) one.
>
> I'd say we need to see how things go and how people use it before we
> should tweak it and maybe making it more complicated than it needs to be.
Keeping it simply is ok. But at least requiring set() and get() to
provide a "namespace" argument would be good to have from start, as you
won't be able to change it as soon as it is released. Just by defining a
syntax everyone should follow as a $key is not strong enough in my eyes.
So I second Basian's idea of:
public function get($namespace, $key, $defaultValue) {}
public function set($namespace, $key, $value) {}
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.
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list