TYPO3 6.2 for extension developer
» Checklist
» Do‘s
» Don‘ts
CPS-IT Mehr Wert im Netz 1
About me
 Known as @IchHabRecht
 Nicole Cordes from Berlin
 Programmer since 1998
 Using TYPO3 since 2007
 Certified TYPO3 integrator since 2011
 Active contributer for TYPO3 CMS since 2013 (6.0)
 Member of security and PHPUnit team
 Working on multiple extensions as contributer
CPS-IT Mehr Wert im Netz 2
Checklist
General
 Remove all include(), include_once(), require(), require_once()
 Use convention over configuration for autoloading
 Or at least an ext_autoload.php file
 Adapt xclasses
Backend
 Use „_DISPATCH“ as script configuration for backend modules
 BackendUtility::getModuleUrl() and BackendUtility::getAjaxUrl()
CPS-IT Mehr Wert im Netz 3
Autoload
 Cache lookup
 Check for core file (namespace TYPO3CMS)
=> Class name reflects folder structure
 Check runtime cache
=> filled with information by loaded ext_autoload.php files
 Get file from class name („extbase convention“)
CPS-IT Mehr Wert im Netz 4
XCLASS
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3CMSPermControllerPermissionModuleController'] = array(
'className' => 'Tx_BeAcl_Xclass_PermissionModuleController',
);
 GeneralUtility::makeInstance()
 Recursive dissolving
CPS-IT Mehr Wert im Netz 5
Dispatch
Changeinconf.php
$MCONF['script']='_DISPATCH';
Remove inindex.php
unset($MCONF);
require_once('conf.php');
require_once($BACK_PATH . 'init.php');
require_once($BACK_PATH . 'template.php');
CPS-IT Mehr Wert im Netz 6
Backend links
$url = TYPO3CMSBackendUtilityBackendUtility::getModuleUrl(
$moduleName,
$urlParameters = array(),
$backPathOverride = FALSE,
$returnAbsoluteUrl = FALSE
);
CPS-IT Mehr Wert im Netz 7
Ajax links
Register your ajax script
TYPO3CMSCoreUtilityExtensionManagementUtility::registerAjaxHandler(
‘myAjaxId’,
‘MyVendormyExtensionPathToClass.php’
);
> Automatically published to TYPO3.settings.ajaxUrls[‘myAjaxId']
Use your ajax script
Ext.Ajax.request({
url: TYPO3.settings.ajaxUrls[‘myAjaxId']
});
CPS-IT Mehr Wert im Netz 8
Do‘s
 Old class names still work due to class mapping
 Old hook names still the same
 Use signal / slots
CPS-IT Mehr Wert im Netz 9
Connect function to signal
TYPO3CMSCoreUtilityGeneralUtility::makeInstance('TYPO3CMSExtbaseSignalSlot
Dispatcher')->connect(
‘SignalClassName',
‘SignalName’,
‘SlotClassNameOrObject',
‘SlotMethodName'
);
Use signal / slots
Find signal
 Function prefixed with “emit”
 Calls dispatch() function from
TYPO3CMSExtbaseSignalSlotDispatcher
> This way you can introduce own signals
CPS-IT Mehr Wert im Netz 10
Don‘ts
General
 Prevent any logic in ext_autoload.php configuration (e.g. require
other files)
 No need for t3lib_div::loadTCA()
Eid scripts
 No need to connect to database by tslib_eidtools::connectDB()
CPS-IT Mehr Wert im Netz 11
Don‘ts
Extbase
 Database driven object are only stored by calling the repository
functions or persisted manually by calling
$this->objectManager->get(
'TYPO3CMSExtbasePersistenceGenericPersistenceManager‚
)->persistAll();
 Disable the backport of the property mapper
plugin.tx_cpsblogexample.features.rewrittenPropertyMapper = 0
 New functions in
TYPO3CMSExtbasePersistenceGenericQuerySettingsInterface
CPS-IT Mehr Wert im Netz 12
Thank you
for your attention!
Contact:
@IchHabRecht
typo3.slack.com
typo3@cordes.co
cps-it.cordes

TYPO3 6.2 for extension developer

  • 1.
    TYPO3 6.2 forextension developer » Checklist » Do‘s » Don‘ts
  • 2.
    CPS-IT Mehr Wertim Netz 1 About me  Known as @IchHabRecht  Nicole Cordes from Berlin  Programmer since 1998  Using TYPO3 since 2007  Certified TYPO3 integrator since 2011  Active contributer for TYPO3 CMS since 2013 (6.0)  Member of security and PHPUnit team  Working on multiple extensions as contributer
  • 3.
    CPS-IT Mehr Wertim Netz 2 Checklist General  Remove all include(), include_once(), require(), require_once()  Use convention over configuration for autoloading  Or at least an ext_autoload.php file  Adapt xclasses Backend  Use „_DISPATCH“ as script configuration for backend modules  BackendUtility::getModuleUrl() and BackendUtility::getAjaxUrl()
  • 4.
    CPS-IT Mehr Wertim Netz 3 Autoload  Cache lookup  Check for core file (namespace TYPO3CMS) => Class name reflects folder structure  Check runtime cache => filled with information by loaded ext_autoload.php files  Get file from class name („extbase convention“)
  • 5.
    CPS-IT Mehr Wertim Netz 4 XCLASS $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3CMSPermControllerPermissionModuleController'] = array( 'className' => 'Tx_BeAcl_Xclass_PermissionModuleController', );  GeneralUtility::makeInstance()  Recursive dissolving
  • 6.
    CPS-IT Mehr Wertim Netz 5 Dispatch Changeinconf.php $MCONF['script']='_DISPATCH'; Remove inindex.php unset($MCONF); require_once('conf.php'); require_once($BACK_PATH . 'init.php'); require_once($BACK_PATH . 'template.php');
  • 7.
    CPS-IT Mehr Wertim Netz 6 Backend links $url = TYPO3CMSBackendUtilityBackendUtility::getModuleUrl( $moduleName, $urlParameters = array(), $backPathOverride = FALSE, $returnAbsoluteUrl = FALSE );
  • 8.
    CPS-IT Mehr Wertim Netz 7 Ajax links Register your ajax script TYPO3CMSCoreUtilityExtensionManagementUtility::registerAjaxHandler( ‘myAjaxId’, ‘MyVendormyExtensionPathToClass.php’ ); > Automatically published to TYPO3.settings.ajaxUrls[‘myAjaxId'] Use your ajax script Ext.Ajax.request({ url: TYPO3.settings.ajaxUrls[‘myAjaxId'] });
  • 9.
    CPS-IT Mehr Wertim Netz 8 Do‘s  Old class names still work due to class mapping  Old hook names still the same  Use signal / slots
  • 10.
    CPS-IT Mehr Wertim Netz 9 Connect function to signal TYPO3CMSCoreUtilityGeneralUtility::makeInstance('TYPO3CMSExtbaseSignalSlot Dispatcher')->connect( ‘SignalClassName', ‘SignalName’, ‘SlotClassNameOrObject', ‘SlotMethodName' ); Use signal / slots Find signal  Function prefixed with “emit”  Calls dispatch() function from TYPO3CMSExtbaseSignalSlotDispatcher > This way you can introduce own signals
  • 11.
    CPS-IT Mehr Wertim Netz 10 Don‘ts General  Prevent any logic in ext_autoload.php configuration (e.g. require other files)  No need for t3lib_div::loadTCA() Eid scripts  No need to connect to database by tslib_eidtools::connectDB()
  • 12.
    CPS-IT Mehr Wertim Netz 11 Don‘ts Extbase  Database driven object are only stored by calling the repository functions or persisted manually by calling $this->objectManager->get( 'TYPO3CMSExtbasePersistenceGenericPersistenceManager‚ )->persistAll();  Disable the backport of the property mapper plugin.tx_cpsblogexample.features.rewrittenPropertyMapper = 0  New functions in TYPO3CMSExtbasePersistenceGenericQuerySettingsInterface
  • 13.
    CPS-IT Mehr Wertim Netz 12 Thank you for your attention! Contact: @IchHabRecht typo3.slack.com typo3@cordes.co cps-it.cordes