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

Oliver Hader oliver at typo3.org
Sun Aug 9 16:45:38 CEST 2009


Hi Ingo,

Ingo Renner schrieb:
> 
> with autoloading...

Some remarks to the patch:

* database
  + field "uid" is never used so why must it be a primary key and
    defined at all?

* method __construct()
  + is it required to have everything from the registry table loaded?
    there could be a method "getByPrefix('tx_whatever')
  + please set "$this->entries = array();"

* method get()
  + is it required that every variable must have a value?
  + the $defaultValue should be optional and set to NULL if not defined
    otherwise undefined variables are not possible with the new registry

* method set()
  + the allowedNameSpacePrefixes should be a class member variable
  + as far as I see, for core variables only stuff like "core.whatever"
    should be possible - but not "coreSomeThing.whatever" - but the
    validation against allowed prefixes does not catch this
  + the check against a dot in the key whould also allow this "tx_test."
  + sql_affected_rows() only returns a positive integer if the database
    record was modified - thus, updating a record without changing the
    data would result in calling an INSERT query and running into a
    "duplicate key" MySQL error in this case

* test cases
  + the registry is used in all tests - thus create $this->registry in
    the setUp method
  + IMO writing test data to a live database on running the tests is not
    a good idea. It would be better to store data to a separate database
    or table. AFAIK there's the database testcase in tx_phpunit...


olly
-- 
Oliver Hader
TYPO3 Release Manager 4.3


More information about the TYPO3-team-core mailing list