[TYPO3-dev] questions about XCLASS replacement in TYPO3 6.2

Jigal van Hemert jigal.van.hemert at typo3.org
Fri May 29 23:44:19 CEST 2015


Hi,

On 29/05/2015 12:38, Franz Holzinger wrote:
> 1.) Why do you call the usage of
> "$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] " still XCLASS? It should
> be called "using System Objects" or similar. Since TYPO3 6.2 the name
> XCLASS should disappear from the manuals.

XCLASS is a well known term. People are still talking about TCEmain 
instead of DataHandler. It's about eXtending CLASSes, so it's not that 
weird to still use the word for it. That is just an opinion.

> 2.) What must be done if the array
> $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\CMS\Backend\Controller\NewRecordController']
> already exists? Shall it be overwritten without any notice? Or is there
> any recommendation for an entry into an error log file?

You could XCLASS the extending class, but that increases the risks.

> 3.) I cannot get System Objects class extending working with an abstract
> class.
> "abstract class AbstractConditionMatcher extends
> \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractConditionMatcher
> {"
> Are abstract classes not supported for extending them?

XCLASSing is done when you instantiate a class object. Abstract classes 
can't be instantiated. If you have an extended abstract class the 
concrete class should extend the extended abstract class and not the 
original abstract class. That would require changing the declaration of 
the original class:

class ConditionMatcher extends AbstractConditionMatcher {

With your XCLASS :
abstract class MyAbstractConditionMatcher extends AbstractConditionMatcher {

and the declaration of ConditionMatcher should read:

class ConditionMatcher extends MyAbstractConditionMatcher {

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org



More information about the TYPO3-dev mailing list