[TYPO3-core] RFC: Another hook request for db_list (#6738)

Ingo Renner ingo at typo3.org
Wed Nov 21 09:17:30 CET 2007


Bernhard Kraft wrote:

Hi Bernhard,

>> I know Ingo and Ingmar is very similar ;-)
> 
> Sorry for that. I always then to call one of you by the name of the 
> other :)

No offense taken ;-)

>> * here both mehtods concern one task (do they really do?) so that I'd 
>> put them into a single interface
> 
> But then I can't name the file (and interface class) either 
> "..._makeClipHook"
> nor "..._makeControlHook". Cause it contains one method for each.
> 
> Proposal:
> ---------
> All hooks for one class go into an interface/file named:

I don't feel that'd be a good idea. As I mentioned before you usually do 
not want to implement all hooks in a class, rather the methods of a hook 
for a specific task.

> ##CLASSNAME##_Hook
> 
> So this would be: "t3lib_localRecordList_Hook" in this case. I would just
> add both new hook methods to the already existing interface class/file
> you created - is that ok for you Ingo ?

really, please don't. Just make up a name that fits the task like

interface.localRecordList_listControlsHook.php
interface localRecordList_listControlsHook { }

we might also need to rename the existing one to make it more generic if 
you see the need and can imagine a good name.

> Additional:
> -----------
> And eventually we should leave the "t3lib_" away. As the original class is
> called just "localRecordList" - i know this conflicts with the usual T3
> naming scheme. So it is dependend on what you think: wheter we should keep
> the current "invalid" naming of those ".inc" classes or try to change the
> slowly to "conventional" T3 naming scheme.

if it's an interface for a non-t3lib class and it resides in 
typo3/interfaces/ the t3lib must be dropped of course (see above), just 
go ahed.

>> * the second parameter in throw new Exception should be the current 
>> unix timestamp at the time you wrote that time (roughly) This will 
>> make sure to easily find the place where the exception was thrown 
>> (apart from the stack trace) as it seems to be unlikely that two devs 
>> will create a hook at the exact same second. The timestamp you used is 
>> from Thursday ...
> 
> Ok. Didn't know that - and wondered what that number is. I hoped it wasn't
> a consecutive number for each exception :)

should get documented somewhere... coding guidelines during next T3DD or 
after 4.2 final release?!

> Patch will be ready in one or two hours ...


awesome!
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list