[TYPO3-core] RFC #10816: tslib_content calls deprecated function makeInstanceClassName
Dmitry Dulepov
dmitry at typo3.org
Wed Apr 1 17:25:52 CEST 2009
Hi!
Susanne Moog wrote:
> I don't think I really get the point but I attached a new version with
> the instantiation (and fixed the else part).
Do you understand what this version really does? ;)
This brakes XCLASSes completely for tslib_cObj. So if anyone XCLASSes any FE extension, this is not going to work anymore. Check what makeInstanceClassName() does.
Suppose there is an XCLASS:
============
class ux_tx_myext_whatever extends tx_myext_whatever {
...
}
============
Here is what was before your patch:
============
$cls = t3lib_div::makeInstanceClassName($parts[0]);
if ($this->isClassAvailable($cls, $conf)) {
$classObj = new $cls;
============
This code roughly equals to:
============
$cls = 'ux_tx_myext_whatever';
if ($this->isClassAvailable($cls, $conf)) {
$classObj = new $cls;
============
Here is what you propose:
============
$cls = t3lib_div::makeInstance($parts[0]);
if ($this->isClassAvailable($parts[0], $conf)) {
$classObj = new $parts[0];
============
This is equals to:
============
$cls = new tx_myext_whatever; // Ignore the result -> wasted memory and CPU cycles
if ($this->isClassAvailable('tx_myext_whatever', $conf)) {
$classObj = new tx_myext_whatever;
============
So with your patch XCLASS will never be instantiated, which is a error.
--
Dmitry Dulepov
Skype: liels_bugs
In the blog: http://dmitry-dulepov.com/article/automatic-realurl-configuration-howto.html
More information about the TYPO3-team-core
mailing list