[Typo3-dev] extending extensions

Boris Nicolai bnscs at gmx.de
Thu Jan 15 09:15:54 CET 2004


well well well,
'til midnight I just sat on my desk with a pencil and a lot of paper, and -
sorry - SUCH A ... nice day!!!
it really drives me crazy because I don't see any problems to extend these
classes - BUT ...
instead of $TYPO3_CONF_VARS[fe][xclass] = string to a userdefined class we
could replace it with an arra while including extensions into the system.
it could look so:

[xlass][tslib/class.tslib_fe.php][0] =
path_to_ext/xtest1/class.ux_tslib_fe.php
[xlass][tslib/class.tslib_fe.php][1] =
path_to_ext/xtest2/class.ux_tslib_fe.php
[xlass][tslib/class.tslib_fe.php][2] =
path_to_ext/xtest3/class.ux_tslib_fe.php

I don't see the problem in building a SUPER-tslib_fe with all the stuff of
the other classes,
but - and this is what I'm getting headache of - what if two of these
classes overwrite the same function? this can happen, it will happen, and
then the extension should ask the user the next time "are you ready for
surprises"?

ok, so far I see only one thing: somewhere it is possible (think positive!),
but not without huge modifications of the WHOLE system and that the
extension-developers rebuild the existing extensions.

so, the question so far, Kasper, Carlos, Igmar and everybody else: what
shall we do if we want to install 3 extension which extend eg. the tslib_fe?
take the extensions, copy manually with an editor all the source into a
superextension and adjust everything? possible, but much work and updates
are not possible...

or we let the extensions extend themself and see if everything works as
expected or if the server starts dancing. for this purpose I would also add
to the extension-manager a tool which examines the installed extensions for
any conflicts.

Especially what you, Kasper, wrote: "class blablabla extends $someClassname"
is not possible, but no problem, because we could create a file, where the
basis-class and the extension-classes are included. this would only be
necessary if a extension is installed/ updated. no performance-problem.

but what happens if ext3 overwrites a function, that is needed by ext2?
or ext2 and ext3 overwrite the same function, for example the constructor?


one idea..let me think about it.
lets take the function processOutput ().
ext1 and ext2 overwrite this function.
I hope you can follow my thoughts now (as well as I hope I can follow them):
tslib_fe sees "know the extension ext1 gets loaded, and instead of my own
function processOutput () I use the function of the extesion". then the
output is somehow cached. now somewhen we come to ext2, and tslib_fe repeats
the same play.
They could be - to say it shortly - we don't look at the extensions and how
the extensions influence the system (we are only talking about the case that
basis-classes are extended!!), but as soon as a function of a basis-class is
called the basis-class looks for current alternative methods. so no
extension would know nothing about any other...
I hope somebody understands what I'm meaning.. :)

hombre, que dificil...
muchos saludos
boris



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Boris Nicolai
IT Director
Coastal Realty SL

Conjunto Casaño, Oficina B4
Avenida Manolete
Nueva Andalucia
29660 Marbella (Spain)

Tel: +34 952 812 949
Fax: +34 952 814 062
Mobile: +34 686 021 339
Email: boris.nicolai at andavida.com

http://www.andavida.com - Hier surft Andalusien
http://www.coastal-realty.co.uk







More information about the TYPO3-dev mailing list