[TYPO3-core] RFC #8985: Enable USER object to become USER_INT on the fly

Ingo Renner ingo at typo3.org
Thu Jul 17 12:41:09 CEST 2008


Dmitry Dulepov [typo3] wrote:


> Martin Kutschker wrote:
>> Should be changed then. No need to load all libs unconditionally. A
>> topic for typo3.performace :-)

definitely

> Yes... I tried changing it but that will be a big change that I want to 
> think more about. Just like with this USER_INT patch, it took lots of 
> thinking.

By now I think we can have autoloading for TYPO3 relatively easy. I 
might post some idea in 4.3 later today.

> tslib_cObj does not use t3lib_div::callUserFunction but its own 
> callUserFunction. It cannot be easily changed to use t3lib_div's because 
> they are incompatible in the way they handle parameters. 

Well, could tslib_cObj work as an adapter to t3lib_div::callUserFunction() ?

> And cObj's 
> version does not accept EXT:-like syntax. Of course, code can copied 
> from t3lib_div but we all know that duplication code is bad.

yeah, and as this is needed quite often I'd propose a new method 
t3lib_div::resolveExtPrefixToPath() (or similar) and make all places 
where this is needed use the new method.

> So there should be another, more elegant solution. If we could use 
> t3lib_div's version, there will be no need for global incluLibs at all. 
> We will just use EXT:-like syntax for plugin userFunc and that's all! It 
> will be loaded only when used.

that'd be cool, no unnecessary includes! When doing some profiling it 
showed that including files is quite slow - and we do a lot of inclusions...

> Current solution is really bad. As soon as you have extension loaded 
> (not used but just loaded in EM!), all its USER plugins will be loaded. 
> Imagine a plugin that includes a huge PHP library... Bad thing :( Even 
> if it is not a huge PHP library but simply loaded but not used 
> extensions - still bad to parse all this unused code.

yepp

> We could also avoid the problem adding delayedIncludeLibs. Keys could be 
> plugin titles and values are file paths. cObj's callUserFunction could 
> include file from delayedIncludeLibs when necessary. This is a quick and 
> dirty solution.

sounds similar to the idea I have concerning autoload
delayed -> lazy (that's a more common term "lazy loading")


Ingo

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


More information about the TYPO3-team-core mailing list