[TYPO3-core] USER_CINT again
Dmitry Dulepov
dima at spamcop.net
Tue Feb 28 18:44:01 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
Martin Kutschker wrote:
>> I think putting it all into userFunc is too much. It makes a big mess.
>
> Don't think it's so a big proble,. Just keep your main small and make it a simple despatcher routine.
Yes this works... But everyone will have to write
function main($content, $conf) {
+ if ($this->firstCall && $this->shouldCache())
+ return true;
return $this->wrapIntoSomething($this->realMain($conf));
}
instead of
plugin.tx_ext_pi1 {
userFunc = tx_ext_pi1->main
+ modeFunc = tx_ext_pi1->shouldCache
}
For me second looks more elegant. Clear separation between content
generation and cache management.
We have various parameters for various cObjects, why cannot we have such
new parameter for USER_CINT? :)
>> Much better to use separate functions: one PHP function per one
>> logical application function.
>
> So we have a myriad of extra method?
Extra TS property. No one even prevents reusing main() as you wish now:
plugin.tx_ext_pi1 {
userFunc = tx_ext_pi1->main
+ modeFunc = tx_ext_pi1->main
}
but if one wants to make it more clear, he have a chance. Even more: by
default modeFunc can be equal to userFunc.
> Normally I'd agree, but I think we won't run into big problems by staying with a single hook for a plugin.
No problems, of course. I just want to make world a little better and
code a little more understandable :) Feel free to do it your way if you
feel I am wrong in this particular case. I do not strongly insist.
Dmitry.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEKWk3RVcYnKJ8N6kRAnsVAJ4qnwKBU/xGBNe8PzZwgManLg7fJACgwQSA
hFWIHkFmbSfhDYwVY+Zjljo=
=2rcX
-----END PGP SIGNATURE-----
More information about the TYPO3-team-core
mailing list