[TYPO3-ect] Reminder: where to put fh_library?

Franz Holzinger franz at fholzinger.com
Sat Jul 28 18:48:15 CEST 2007


Hello Elmar,

> That's right. lib/div shall be able to provide all features tslib_pibase
> does -- and much more. But there are reasons to implement functions into
> div that are not directly related to lib:
> 
> 2.) We need to provide a migration path from tslib_pibase to lib. (see
> below)
> 
> Maybe we could separate div into 2 classes:
> 
>   tx_div: static methods related to lib
>   tx_div_open: static methods that compete with lib
> 
> (other ideas: tx_div_x, tx_div_plus, tx_div_free)
> 
> Would that be sensible solution?

tx_div_alpha

temporary alpha solution,
It should be avoided to use this class in the future. It is used for the
migration from pibase and other libraries to div/lib.

tx_div_beta

Here the interface is already almost stable

tx_div

Finished now in the final state.
If additional features are needed, then an enhanced version of this
function can be under a similar name again in tx_div_alpha or
tx_div_beta. This will replace the former function later.

tx_div_deprecated

These methods should not be used any more.

tx_div_all

There should be an object which has each of them as member objects and
implements all methods. Then the extension can use all methods without
any needs to care about the object.

> I am thinking of a "migration controller". That controller would mix the API
> of tslib_pibase with the API of tx_lib_controller. People would start by
> exchanging the parent object
> 
>   class myExtension extends tslib_pibase { ... }
> 
> first to "dirty".
> 
>   class myExtension extends tx_lib_pibaseController { ... }
> 
> When the migration is done the change to "clean"
> 
>   class myExtension extends tx_lib_controller { ... }
> 
> Unfortunatly PHP can't inherit an object from 2 parent object. So a huge
> interface needs to be written to map all the function of tslib_pibase.
> That's why this is on the roadmap later.

I think it is very good that one object can inherit only from one other
object. This has been introduced with Java as an advantage to C++. This
is because multiple inheritance would make the things too complex and is
error prone.

Use this:
class myExtension extends tslib_pibase {

$divOjb;

$divOjb = &t3lib_div::getUserObj('&myExtensionDiv');
...

 }

So we create a DIV object inside of each pibase extension which will
additiionally be globally available to other extensions.

- Franz






More information about the TYPO3-team-extension-coordination mailing list