SlideShare a Scribd company logo
0CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
CertiFUNcation 2017
Best Practices Extension Development for TYPO3 8 LTS
1CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Summary
2CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Summary
Changes
» Configuration Bootstrap
» Doctrine
» Fluid Standalone
3CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
4CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Directories
» Classes
» Configuration
» Documentation
» Resources
» Tests
5CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Classes
» Home of your PHP files
» Common subfolders:
» Controller
» Domain
» Model
» Repository
» Hooks
» Plugin
» Service
» ViewHelpers
6CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Configuration
» FlexForms
» XML files used to make extension plugins configurable
» TCA
» configuration for own extension tables; file names supposed to equal table name; an array has to be
returned
» subfolder: Overrides
» contains general table changes for non-extension tables
» TSconfig
» contains page and/or user TypoScript configuration files
» TypoScript
» constants.typoscript
» setup.typoscript
7CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Documentation
» user manual
» reStructuredText (ReST) files
» typical files:
» Includes.txt
» Index.rst
» Settings.yml
» can be rendered by using EXT:sphinx
8CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Resources
» Private
» Language – XLF files for your language labels
» Layouts – HTML files for Fluid Templates
» Partials – HTML files for Fluid Templates
» Php – external PHP-Code (e.g. phar files, libraries)
» Templates – HTML files for Fluid
» TypeScript – TS files for JavaScript compiling
» Public
» Css – CSS Stylesheet files
» Fonts – font files used in Stylesheet (e.g. EOT, SVG, TTF, WOFF)
» Icons – Icons used in Frontend and/or Backend
» Images – Images used in Frontend and/or Backend
» JavaScript – JS files used in Frontend and/or Backend
9CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Tests
» Acceptance
» tests based on Codeception
» Functional
» tests based on PHPUnit with an isolated TYPO3 instance and database access
» JavaScript
» tests based on JUNIT
» Unit
» tests based on PHPUnit to test smaller parts of your code
10CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Structure
Files
» ext_emconf.php
» mandatory file to describe your extension
» ext_icon.svg, ext_icon.png or ext_icon.gif
» icon used to display your extension in Extension Manager and on typo3.org
» note: icons moved to Resources/Public/Icons/Extension.[svg, png, gif] with a legacy handling, but
TER isn’t compatible at the moment and still uses old icon file names
» ext_localconf.php
» Configuration file for hook/slot registration, plugin configuration, TYPO3_CONF_VARS configuration
» ext_tables.php
» backend configuration e.g. for modules, hook/slot registration
» ext_tables.sql
» SQL definitions for your extension tables as well as changes to existing database tables
11CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Configuration
files
12CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Configuration files
TCA
» table configuration for new extension tables
» additional table configuration for existing tables
» TYPO3CMSCoreUtilityExtensionManagementUtility::addStaticFile()
» add own TypoScript files
» TYPO3CMSCoreUtilityExtensionManagementUtility::makeCategorizable()
» turn a field into a category field
» TYPO3CMSCoreUtilityExtensionManagementUtility::registerPageTSConfigFile()
» add a page TSconfig file to pages `Include Page TSConfig` field
» TYPO3CMSExtbaseUtilityExtensionUtility::registerPlugin()
» TYPO3CMSCoreUtilityExtensionManagementUtility::addPlugin()
» add plugin to tt_content `Selected Plugin` field
13CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Configuration files
ext_localconf.php
» earliest Boostrap entry point
» contains:
» TYPO3_CONF_VARS configuration
» hook/slot registration
» TYPO3CMSCoreUtilityExtensionManagementUtility::addPageTSConfig()
» TYPO3CMSCoreUtilityExtensionManagementUtility::addUserTSConfig()
» add own TSconfig configuration
» TYPO3CMSCoreUtilityExtensionManagementUtility::addTypoScript()
» add additional (plain) TypoScript
» TYPO3CMSCoreUtilityExtensionManagementUtility::registerAjaxHandler()
» add own ajax handler
14CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Configuration files
ext_tables.php
» loaded in backend mode only
» (in frontend mode only with valid backend user authentication)
» contains:
» TYPO3CMSCoreUtilityExtensionManagementUtility::addLLrefForTCAdescr()
» load additional description reference files
» TYPO3CMSCoreUtilityExtensionManagementUtility::addModule()
» add an own backend module
» TYPO3CMSCoreUtilityExtensionManagementUtility::allowTableOnStandardPages()
» allow records on standard pages
15CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Configuration files
General recommendation
» check TYPO3 mode
» defined('TYPO3_MODE') or die('Access denied.');
» prevent global scope
» (function()
{
// your code goes in here
})();
16CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Doctrine DBAL
17CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Doctrine DBAL
Database API
» support different database system (MySQL, PostgreSQL, MSSQL)
» use PHP standard packages
» remove old legacy dependencies
» define different database credentials (table mapping)
18CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Doctrine DBAL
QueryBuilder
» $queryBuilder = TYPO3CMSCoreUtilityGeneralUtility::makeInstance(
TYPO3CMSCoreDatabaseConnectionPool::class
)
->getQueryBuilderForTable('pages');
» $queryBuilder
->select('*')
->from('pages')
->execute();
» while ($row = $result->fetch()) {
}
19CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Doctrine DBAL
Restrictions
» applied automatically to the QueryBuilder
» TYPO3CMSCoreDatabaseQueryRestrictionDeletedRestriction
» TYPO3CMSCoreDatabaseQueryRestrictionHiddenRestriction
» TYPO3CMSCoreDatabaseQueryRestrictionStartTimeRestriction
» TYPO3CMSCoreDatabaseQueryRestrictionEndTimeRestriction
» remove all restrictions and add only single ones
» $queryBuilder
->getRestrictions()
->removeAll()
->add(TYPO3CMSCoreUtilityGeneralUtility::makeInstance(
TYPO3CMSCoreDatabaseQueryRestrictionDeletedRestriction::class
));
20CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Common
pitfalls
21CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Common pitfalls
Dependencies
» set dependencies to TYPO3 core extensions you are using
» e.g. backend, core, extbase, fluid, scheduler
» set version constraints only to existing versions
» you don‘t know which changes will come in the future
» prevent versions like 7.99.99, 8.99.99
» test the extension in the version(s) you claim to be compatible
22CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Common pitfalls
Fluid
» variables containing objects do not belong into quotes
» wrong: {f:uri.image(image: '{slide}')}
» throws an error because Fluid tries to encode strings automatically
» fix: {f:uri.image(image: slide)}
23CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Common pitfalls
Fluid
» output encoding due to Fluid Standalone’s behavior change
» you need to explicitly turn encoding off in the ViewHelper
» two new properties of ViewHelpers to turn escaping off
» protected $escapeChildren = false;
» variables in the renderChildren clause are not encoded by default
» necessary if the ViewHelper handles the encoding itself
» protected $escapeOutput = false;
» the whole ViewHelper output will not be encoded by default
» necessary if the ViewHelper returns HTML
24CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General
recommendations
25CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General recommendations
Use PHP7 features
» strict type declaration
» declare (strict_types = 1);
» type hinting for function parameter
» return type annotation
» public function getInformationForTable(string $tableName): array
» null coalescing operator
» $username = $_GET['user'] ?? 'nobody';
26CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General recommendations
Publish on GitHub
» not TYPO3 only
» wide range of users
» they can give feedback (add issues/requests)
» they can easily fix or extend your extension (pull requests)
» multiple services as integrations
27CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General recommendations
Publish on Packagist
» if a composer.json file is present, the registration on Packagist is mandatory
» claim your vendor name for security reason
» choose your vendor name wisely
» otherwise you will never be able to publish the extension on Packagist
» GitHub offers an integration for Packagist
» you never have to do anything again
28CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General recommendations
Watch your Code Style
» use PSR-2 code style in your PHP code
» add Style CI for automated code style tests
» GitHub offers an integration
» faster than running CI server with PHP-CS-Fixer
» offer PHP-CS-Fixer configuration for easy command-line fixing
29CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
General recommendations
Test your code
» You don't have tests?
» There is still something to test!
» run PHP linting
» integrate Travis CI for automated testing
» GitHub offers an integration
» build is triggered for push and pull requests
» try to write unit and/or functional tests for bugs
30CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Additional
information
31CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Additional information
Links
» TYPO3 documentation
» Extension directory structure
» https://docs.typo3.org/typo3cms/CodingGuidelinesReference/FileSystemConventions/ExtensionDirec
toryStructure/Index.html
» TYPO3 documentation
» TCA Reference
» https://docs.typo3.org/typo3cms/TCAReference/Introduction/Index.html
» TYPO3Wiki
» Extension Developers Guide
» https://wiki.typo3.org/Extension_Developers_Guide
» Use TYPO3
» Good Practices in Extensions
» https://usetypo3.com/good-practices-in-extensions.html
32CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
Additional information
Links
» Jans Blog
» Migrate from the TYPO3 database wrapper to the Doctrine DBAL syntax
» http://jans-blog.helke.de/2016/04/14/migrate-from-the-typo3-database-wrapper-to-the-doctrine-dbal-
syntax/
» doc_core_insight
» TYPO3 Extension dependencies revisited
» http://insight.helhum.io/post/155297666635/typo3-extension-dependencies-revisited
» PHP
» Migrating from PHP 5.6.x to PHP 7.0.x
» http://php.net/manual/de/migration70.php
33CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz
33
Thanks
for your attention!

More Related Content

What's hot

Get happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend ConfigurationGet happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend Configuration
Peter Kraume
 
backend
backendbackend
backend
tutorialsruby
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
Jérôme Esnault
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
Artefactual Systems - AtoM
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
sparkfabrik
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
Daniel Pfeifer
 
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Nuvole
 
Drupal 8 Configuration Management with Features
Drupal 8 Configuration Management with FeaturesDrupal 8 Configuration Management with Features
Drupal 8 Configuration Management with Features
Nuvole
 
C make tutorial
C make tutorialC make tutorial
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
Michael Peacock
 
BPMS1
BPMS1BPMS1
Powerful and flexible templates with Twig
Powerful and flexible templates with Twig Powerful and flexible templates with Twig
Powerful and flexible templates with Twig
Michael Peacock
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
Pavan Kumar N
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
Allie Jones
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
Gerald Villorente
 
Drupal 8 deploying
Drupal 8 deployingDrupal 8 deploying
Drupal 8 deploying
Andrew Siz
 
Apache
ApacheApache
Apache
rsibbaluca
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and Process
Marcus Hanwell
 

What's hot (19)

Get happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend ConfigurationGet happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend Configuration
 
backend
backendbackend
backend
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
 
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
 
Drupal 8 Configuration Management with Features
Drupal 8 Configuration Management with FeaturesDrupal 8 Configuration Management with Features
Drupal 8 Configuration Management with Features
 
C make tutorial
C make tutorialC make tutorial
C make tutorial
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
 
BPMS1
BPMS1BPMS1
BPMS1
 
Powerful and flexible templates with Twig
Powerful and flexible templates with Twig Powerful and flexible templates with Twig
Powerful and flexible templates with Twig
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Drupal 8 deploying
Drupal 8 deployingDrupal 8 deploying
Drupal 8 deploying
 
Apache
ApacheApache
Apache
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and Process
 

Similar to CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS

2011-03-29 London - drools
2011-03-29 London - drools2011-03-29 London - drools
2011-03-29 London - drools
Geoffrey De Smet
 
The Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 SitepackagesThe Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 Sitepackages
Benjamin Kott
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Animesh Singh
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
Mohammad Shaker
 
VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011
djmichael156
 
Ztech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplicationZtech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplication
Chris Clark
 
optimizing_ceph_flash
optimizing_ceph_flashoptimizing_ceph_flash
optimizing_ceph_flash
Vijayendra Shamanna
 
Enterprise guide to building a Data Mesh
Enterprise guide to building a Data MeshEnterprise guide to building a Data Mesh
Enterprise guide to building a Data Mesh
Sion Smith
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
Oro Inc.
 
SLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure PlatformSLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure Platform
Yoshitake Kobayashi
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology Overview
Haim Ben Zagmi
 
Css Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder.com | Cssfounder Net
Css Founder.com | Cssfounder Net
Css Founder
 
CBUSSE_052015
CBUSSE_052015CBUSSE_052015
CBUSSE_052015
Charles Bussell
 
A Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate DataA Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate Data
Robert Grossman
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of Scientists
Andreas Schreiber
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data Management
Andreas Schreiber
 
Clipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving SystemClipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving System
Databricks
 
WWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
WWW09 - Triplify Light-Weight Linked Data Publication from Relational DatabasesWWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
WWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
Sören Auer
 
(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections
BIOVIA
 
Tony Reid Resume
Tony Reid ResumeTony Reid Resume
Tony Reid Resume
storyhome
 

Similar to CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS (20)

2011-03-29 London - drools
2011-03-29 London - drools2011-03-29 London - drools
2011-03-29 London - drools
 
The Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 SitepackagesThe Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 Sitepackages
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011
 
Ztech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplicationZtech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplication
 
optimizing_ceph_flash
optimizing_ceph_flashoptimizing_ceph_flash
optimizing_ceph_flash
 
Enterprise guide to building a Data Mesh
Enterprise guide to building a Data MeshEnterprise guide to building a Data Mesh
Enterprise guide to building a Data Mesh
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
SLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure PlatformSLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure Platform
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology Overview
 
Css Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder.com | Cssfounder Net
Css Founder.com | Cssfounder Net
 
CBUSSE_052015
CBUSSE_052015CBUSSE_052015
CBUSSE_052015
 
A Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate DataA Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate Data
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of Scientists
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data Management
 
Clipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving SystemClipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving System
 
WWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
WWW09 - Triplify Light-Weight Linked Data Publication from Relational DatabasesWWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
WWW09 - Triplify Light-Weight Linked Data Publication from Relational Databases
 
(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections
 
Tony Reid Resume
Tony Reid ResumeTony Reid Resume
Tony Reid Resume
 

More from cpsitgmbh

Fluid Security
Fluid SecurityFluid Security
Fluid Security
cpsitgmbh
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
cpsitgmbh
 
Functional tests for dummies
Functional tests for dummiesFunctional tests for dummies
Functional tests for dummies
cpsitgmbh
 
Unit tests for dummies
Unit tests for dummiesUnit tests for dummies
Unit tests for dummies
cpsitgmbh
 
TYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup DayTYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup Day
cpsitgmbh
 
Functional tests with TYPO3
Functional tests with TYPO3Functional tests with TYPO3
Functional tests with TYPO3
cpsitgmbh
 
TYPO3 Caching
TYPO3 CachingTYPO3 Caching
TYPO3 Caching
cpsitgmbh
 
Hooks
HooksHooks
Hooks
cpsitgmbh
 

More from cpsitgmbh (8)

Fluid Security
Fluid SecurityFluid Security
Fluid Security
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
 
Functional tests for dummies
Functional tests for dummiesFunctional tests for dummies
Functional tests for dummies
 
Unit tests for dummies
Unit tests for dummiesUnit tests for dummies
Unit tests for dummies
 
TYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup DayTYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup Day
 
Functional tests with TYPO3
Functional tests with TYPO3Functional tests with TYPO3
Functional tests with TYPO3
 
TYPO3 Caching
TYPO3 CachingTYPO3 Caching
TYPO3 Caching
 
Hooks
HooksHooks
Hooks
 

Recently uploaded

Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
APNIC
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
Infosec train
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
Alec Kassir cozmozone
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
thezot
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
APNIC
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 

Recently uploaded (14)

Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
Integrating Physical and Cybersecurity to Lower Risks in Healthcare!
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 

CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS

  • 1. 0CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
  • 2. 1CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Summary
  • 3. 2CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Summary Changes » Configuration Bootstrap » Doctrine » Fluid Standalone
  • 4. 3CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure
  • 5. 4CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Directories » Classes » Configuration » Documentation » Resources » Tests
  • 6. 5CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Classes » Home of your PHP files » Common subfolders: » Controller » Domain » Model » Repository » Hooks » Plugin » Service » ViewHelpers
  • 7. 6CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Configuration » FlexForms » XML files used to make extension plugins configurable » TCA » configuration for own extension tables; file names supposed to equal table name; an array has to be returned » subfolder: Overrides » contains general table changes for non-extension tables » TSconfig » contains page and/or user TypoScript configuration files » TypoScript » constants.typoscript » setup.typoscript
  • 8. 7CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Documentation » user manual » reStructuredText (ReST) files » typical files: » Includes.txt » Index.rst » Settings.yml » can be rendered by using EXT:sphinx
  • 9. 8CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Resources » Private » Language – XLF files for your language labels » Layouts – HTML files for Fluid Templates » Partials – HTML files for Fluid Templates » Php – external PHP-Code (e.g. phar files, libraries) » Templates – HTML files for Fluid » TypeScript – TS files for JavaScript compiling » Public » Css – CSS Stylesheet files » Fonts – font files used in Stylesheet (e.g. EOT, SVG, TTF, WOFF) » Icons – Icons used in Frontend and/or Backend » Images – Images used in Frontend and/or Backend » JavaScript – JS files used in Frontend and/or Backend
  • 10. 9CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Tests » Acceptance » tests based on Codeception » Functional » tests based on PHPUnit with an isolated TYPO3 instance and database access » JavaScript » tests based on JUNIT » Unit » tests based on PHPUnit to test smaller parts of your code
  • 11. 10CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Structure Files » ext_emconf.php » mandatory file to describe your extension » ext_icon.svg, ext_icon.png or ext_icon.gif » icon used to display your extension in Extension Manager and on typo3.org » note: icons moved to Resources/Public/Icons/Extension.[svg, png, gif] with a legacy handling, but TER isn’t compatible at the moment and still uses old icon file names » ext_localconf.php » Configuration file for hook/slot registration, plugin configuration, TYPO3_CONF_VARS configuration » ext_tables.php » backend configuration e.g. for modules, hook/slot registration » ext_tables.sql » SQL definitions for your extension tables as well as changes to existing database tables
  • 12. 11CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Configuration files
  • 13. 12CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Configuration files TCA » table configuration for new extension tables » additional table configuration for existing tables » TYPO3CMSCoreUtilityExtensionManagementUtility::addStaticFile() » add own TypoScript files » TYPO3CMSCoreUtilityExtensionManagementUtility::makeCategorizable() » turn a field into a category field » TYPO3CMSCoreUtilityExtensionManagementUtility::registerPageTSConfigFile() » add a page TSconfig file to pages `Include Page TSConfig` field » TYPO3CMSExtbaseUtilityExtensionUtility::registerPlugin() » TYPO3CMSCoreUtilityExtensionManagementUtility::addPlugin() » add plugin to tt_content `Selected Plugin` field
  • 14. 13CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Configuration files ext_localconf.php » earliest Boostrap entry point » contains: » TYPO3_CONF_VARS configuration » hook/slot registration » TYPO3CMSCoreUtilityExtensionManagementUtility::addPageTSConfig() » TYPO3CMSCoreUtilityExtensionManagementUtility::addUserTSConfig() » add own TSconfig configuration » TYPO3CMSCoreUtilityExtensionManagementUtility::addTypoScript() » add additional (plain) TypoScript » TYPO3CMSCoreUtilityExtensionManagementUtility::registerAjaxHandler() » add own ajax handler
  • 15. 14CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Configuration files ext_tables.php » loaded in backend mode only » (in frontend mode only with valid backend user authentication) » contains: » TYPO3CMSCoreUtilityExtensionManagementUtility::addLLrefForTCAdescr() » load additional description reference files » TYPO3CMSCoreUtilityExtensionManagementUtility::addModule() » add an own backend module » TYPO3CMSCoreUtilityExtensionManagementUtility::allowTableOnStandardPages() » allow records on standard pages
  • 16. 15CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Configuration files General recommendation » check TYPO3 mode » defined('TYPO3_MODE') or die('Access denied.'); » prevent global scope » (function() { // your code goes in here })();
  • 17. 16CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Doctrine DBAL
  • 18. 17CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Doctrine DBAL Database API » support different database system (MySQL, PostgreSQL, MSSQL) » use PHP standard packages » remove old legacy dependencies » define different database credentials (table mapping)
  • 19. 18CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Doctrine DBAL QueryBuilder » $queryBuilder = TYPO3CMSCoreUtilityGeneralUtility::makeInstance( TYPO3CMSCoreDatabaseConnectionPool::class ) ->getQueryBuilderForTable('pages'); » $queryBuilder ->select('*') ->from('pages') ->execute(); » while ($row = $result->fetch()) { }
  • 20. 19CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Doctrine DBAL Restrictions » applied automatically to the QueryBuilder » TYPO3CMSCoreDatabaseQueryRestrictionDeletedRestriction » TYPO3CMSCoreDatabaseQueryRestrictionHiddenRestriction » TYPO3CMSCoreDatabaseQueryRestrictionStartTimeRestriction » TYPO3CMSCoreDatabaseQueryRestrictionEndTimeRestriction » remove all restrictions and add only single ones » $queryBuilder ->getRestrictions() ->removeAll() ->add(TYPO3CMSCoreUtilityGeneralUtility::makeInstance( TYPO3CMSCoreDatabaseQueryRestrictionDeletedRestriction::class ));
  • 21. 20CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Common pitfalls
  • 22. 21CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Common pitfalls Dependencies » set dependencies to TYPO3 core extensions you are using » e.g. backend, core, extbase, fluid, scheduler » set version constraints only to existing versions » you don‘t know which changes will come in the future » prevent versions like 7.99.99, 8.99.99 » test the extension in the version(s) you claim to be compatible
  • 23. 22CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Common pitfalls Fluid » variables containing objects do not belong into quotes » wrong: {f:uri.image(image: '{slide}')} » throws an error because Fluid tries to encode strings automatically » fix: {f:uri.image(image: slide)}
  • 24. 23CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Common pitfalls Fluid » output encoding due to Fluid Standalone’s behavior change » you need to explicitly turn encoding off in the ViewHelper » two new properties of ViewHelpers to turn escaping off » protected $escapeChildren = false; » variables in the renderChildren clause are not encoded by default » necessary if the ViewHelper handles the encoding itself » protected $escapeOutput = false; » the whole ViewHelper output will not be encoded by default » necessary if the ViewHelper returns HTML
  • 25. 24CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations
  • 26. 25CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations Use PHP7 features » strict type declaration » declare (strict_types = 1); » type hinting for function parameter » return type annotation » public function getInformationForTable(string $tableName): array » null coalescing operator » $username = $_GET['user'] ?? 'nobody';
  • 27. 26CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations Publish on GitHub » not TYPO3 only » wide range of users » they can give feedback (add issues/requests) » they can easily fix or extend your extension (pull requests) » multiple services as integrations
  • 28. 27CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations Publish on Packagist » if a composer.json file is present, the registration on Packagist is mandatory » claim your vendor name for security reason » choose your vendor name wisely » otherwise you will never be able to publish the extension on Packagist » GitHub offers an integration for Packagist » you never have to do anything again
  • 29. 28CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations Watch your Code Style » use PSR-2 code style in your PHP code » add Style CI for automated code style tests » GitHub offers an integration » faster than running CI server with PHP-CS-Fixer » offer PHP-CS-Fixer configuration for easy command-line fixing
  • 30. 29CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz General recommendations Test your code » You don't have tests? » There is still something to test! » run PHP linting » integrate Travis CI for automated testing » GitHub offers an integration » build is triggered for push and pull requests » try to write unit and/or functional tests for bugs
  • 31. 30CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Additional information
  • 32. 31CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Additional information Links » TYPO3 documentation » Extension directory structure » https://docs.typo3.org/typo3cms/CodingGuidelinesReference/FileSystemConventions/ExtensionDirec toryStructure/Index.html » TYPO3 documentation » TCA Reference » https://docs.typo3.org/typo3cms/TCAReference/Introduction/Index.html » TYPO3Wiki » Extension Developers Guide » https://wiki.typo3.org/Extension_Developers_Guide » Use TYPO3 » Good Practices in Extensions » https://usetypo3.com/good-practices-in-extensions.html
  • 33. 32CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz Additional information Links » Jans Blog » Migrate from the TYPO3 database wrapper to the Doctrine DBAL syntax » http://jans-blog.helke.de/2016/04/14/migrate-from-the-typo3-database-wrapper-to-the-doctrine-dbal- syntax/ » doc_core_insight » TYPO3 Extension dependencies revisited » http://insight.helhum.io/post/155297666635/typo3-extension-dependencies-revisited » PHP » Migrating from PHP 5.6.x to PHP 7.0.x » http://php.net/manual/de/migration70.php
  • 34. 33CertiFUNcation 2017, Best Practices Extension Development for TYPO3 8 LTS, Nicole Cordes, CPS-IT Mehr Wert im Netz 33 Thanks for your attention!