[Typo3-dev] User extension of class.t3lib_div.php

Christian Jul Jensen christian at julletology.dk
Tue Sep 2 14:39:04 CEST 2003


Hi

On Tue, 2 Sep 2003 14:23:11 +0200, Christian Jul Jensen
<christian at julletology.dk> wrote:

> > ...which makes this suggestion obsolete:
> > > Maybe makeInstance should be moved to a class for itself in future
> > > releases, in order to avoid this problem.
> 
> You're right. Still these functions should be extend-/changeable, so
> maybe making a global object $DIV, instantiated by
> t3lib_div::makeInstance('t3lib_div'); would be a solution. That way
> you could actually modify even the makeInstance function.


Another way to do approx the same, but without having a global object.

in t3lib_div

call_div_function($fnName) {
   $className = class_exists('ux_t3lib_div')?'ux_t3lib_div':$this;
   $argArr = func_get_args();
   array_shift($argArr);
   return call_user_func_array(Array($className,$fnName),$argArr);
);


And then replacing all calls to the class from t3lib_div::function(...)
to t3lib_div::call_div_function('function',...)

-- 
Christian Jul Jensen
Freelance webprogrammer
TYPO3 typehead Denmark




More information about the TYPO3-dev mailing list