[TYPO3-english] Re: Hints for writing extensions for TYPPO3 4.5 to 6.1

Norbert Sendetzky n.sendetzky at metaways.de
Mon Feb 17 11:29:41 CET 2014


Hi Helmut

> > t3lib_FlashMessageQueue::addMessage( new t3lib_FlashMessage( '<message>', 'Error', t3lib_Flashmessage::ERROR );
> 
> I wouldn't recommend doing so. Instead I would use the API introduced in 
> 6.2 (compatible to FLow API) that is calling ->addFlashMessage in your 
> controller code. Since there is no such API is present in older versions 
> you would need to implement the method yourself and do feature detection 
> in there.

As the new API isn't available in versions before 6.2, why should an extension developer take the burden of implementing two APIs if the old one still works for all versions up to now? As soon as the old API isn't supported any more (will be the case in 6.3 or 6.4), we have to make a cut anyway by dropping support for 4.x

> Old interface names are aliased to the new interface names. With PHP > 
> 5.3.7 using old interface names should work out without issues. Be sure 
> to remove require statements on TYPO3 core classes or interfaces though.
> 
> Same for tx_scheduler_Module which is aliased to 
> \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController

That's interesting and I will try that because it would save some code in our extension.

> > 'tx_arcavias_scheduler_task_typo4' =>  $extensionPath . 'Classes/Scheduler/Task/Typo4.php',
> > 'tx_arcavias_scheduler_provider_typo4' =>  $extensionPath . 'Classes/Scheduler/Provider/Typo4.php',
> > 'Arcavias\Arcavias\Scheduler\Task\Typo6' =>  $extensionPath . 'Classes/Scheduler/Task/Typo6.php',
> > 'Arcavias\Arcavias\Scheduler\Provider\Typo6' =>  $extensionPath . 'Classes/Scheduler/Provider/Typo6.php',
> 
> Besides that, I highly recommend *not* to use the autoloding registry at 
> all. Instead use class names and file structure according to our naming 
> convention.
> 
> If you use Extbase, class names will be resolved automatically since 
> TYPO3 4.3

Yes, our extension is implemented with Extbase and I've heard a lot of times that ext_autoload.php isn't needed if your classes are located according to their naming. This works great with controller classes but I couldn't get it to work with scheduler and flexform support classes in all supported TYPO3 versions, e.g. 

Tx_Arcavias_Scheduler_Task_Typo4
should be in 
typo3conf/ext/arcavias/Classes/Scheduler/Task/Typo4.php

but it isn't found in that location in TYPO3 4.5 (the oldest release we currently support). There are also no require statements used in our code for that class. In 6.x it works without problems :-)


Norbert



More information about the TYPO3-english mailing list