SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
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!

Más contenido relacionado

Was ist angesagt?

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 ConfigurationPeter Kraume
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake TutorialFu 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
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practicesDaniel 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 FeaturesNuvole
 
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 TalkMichael Peacock
 
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 ApplicationsPavan Kumar N
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
Drupal 8 deploying
Drupal 8 deployingDrupal 8 deploying
Drupal 8 deployingAndrew Siz
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessMarcus Hanwell
 

Was ist angesagt? (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
 

Ähnlich wie 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 - droolsGeoffrey De Smet
 
The Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 SitepackagesThe Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 SitepackagesBenjamin 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 - IntroMohammad 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 22032011djmichael156
 
Ztech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplicationZtech Connect '19, IBM PureApplication
Ztech Connect '19, IBM PureApplicationChris Clark
 
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 MeshSion Smith
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015Oro 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 PlatformYoshitake Kobayashi
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology OverviewHaim Ben Zagmi
 
Css Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder
 
A Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate DataA Gen3 Perspective of Disparate Data
A Gen3 Perspective of Disparate DataRobert Grossman
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsAndreas 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 ManagementAndreas 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 SystemDatabricks
 
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 DatabasesSö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 collectionsBIOVIA
 
Tony Reid Resume
Tony Reid ResumeTony Reid Resume
Tony Reid Resumestoryhome
 

Ähnlich wie 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
 

Mehr von cpsitgmbh

Fluid Security
Fluid SecurityFluid Security
Fluid Securitycpsitgmbh
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelinescpsitgmbh
 
Functional tests for dummies
Functional tests for dummiesFunctional tests for dummies
Functional tests for dummiescpsitgmbh
 
Unit tests for dummies
Unit tests for dummiesUnit tests for dummies
Unit tests for dummiescpsitgmbh
 
TYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup DayTYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup Daycpsitgmbh
 
Functional tests with TYPO3
Functional tests with TYPO3Functional tests with TYPO3
Functional tests with TYPO3cpsitgmbh
 
TYPO3 Caching
TYPO3 CachingTYPO3 Caching
TYPO3 Cachingcpsitgmbh
 

Mehr von 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
 

Último

Generalities about NFT , as a new technology
Generalities about NFT , as a new technologyGeneralities about NFT , as a new technology
Generalities about NFT , as a new technologysoufianbouktaib1
 
Google-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfGoogle-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfMaria Adalfio
 
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC
 
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...hasimatwork
 
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondContinuent
 
Benefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxBenefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxlibertyuae uae
 
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?krc0yvm5
 
SQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxSQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxJustineGarcia32
 
overview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualizationoverview of Virtualization, concept of Virtualization
overview of Virtualization, concept of VirtualizationRajan yadav
 
Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Eric Johnson
 

Último (10)

Generalities about NFT , as a new technology
Generalities about NFT , as a new technologyGeneralities about NFT , as a new technology
Generalities about NFT , as a new technology
 
Google-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdfGoogle-Next-Madrid-BBVA-Research inv.pdf
Google-Next-Madrid-BBVA-Research inv.pdf
 
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
 
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
Section 3 - Technical Sales Foundations for IBM QRadar for Cloud (QRoC)V1 P10...
 
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
 
Benefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptxBenefits of Fiber Internet vs. Traditional Internet.pptx
Benefits of Fiber Internet vs. Traditional Internet.pptx
 
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?如何办理朴茨茅斯大学毕业证书学位证书成绩单?
如何办理朴茨茅斯大学毕业证书学位证书成绩单?
 
SQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptxSQL Server on Azure VM datasheet.dsadaspptx
SQL Server on Azure VM datasheet.dsadaspptx
 
overview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualizationoverview of Virtualization, concept of Virtualization
overview of Virtualization, concept of Virtualization
 
Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019Mary Meeker Internet Trends Report for 2019
Mary Meeker Internet Trends Report for 2019
 

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!