Import Data within TYPO3
TYPO3 developers are often faced with the same requirement: Import data into TYPO3. TYPO3 itself offers many ways to import data into the system. The DataHandler (TCE) or Extbase might come to your mind, as well as plain Doctrine DBAL queries. This post will explain my views on each of the options and their pros and cons. I don't consider any of them the general solution, but the pros and cons might help you find the one suiting your current use case best.
DataHandler ¶
I always would suggest DataHandler first for the following reasons:
- API is pretty simple, build a single array and submit.
- It handles everything you can think of, and everything you don't remember:
- History
- Logging
- Relations
- Permissions
- Hooks (indexing in solr, or whatever your system uses hooks for)
- Cache flushing
- … (things I forgot)
But there are some downsides:
- It is slow (You can tweak the DataHandler instance to skip some things and be more performant)
- It might do more than you want, e.g. history, logging, relations, permissions, hooks, cache flushing, ….
Doctrine DBAL ¶
I than would recommend Doctrine DBAL for the following reasons:
- You are in full control. You can do exactly what you want the way you want, and can optimize for memory and performance.
But it also has downsides:
- You need to remember all necessary steps and rebuild integrations, e.g. indexing into solr, triggering cache flushes, etc.
Extbase ¶
And then there is Extbase for the following reasons:
- You stay in OOP
- Most developers are probably more familiar with Extbase than the other APIs
With downsides:
- It was not build for that task.
- You need to add workarounds to keep performance okay.
- You still need to do extra work like triggering indexing, cache flushing, etc.
It depends ¶
I would say it depends on:
- What do you need from the system, do you need hooks, logging (history) and cache flushing?
- Do you know what you do and want to have full control over every aspect?
- How much data do you have, how much memory and time do you have?
- Do you want to keep OOP?
This is a recurring topic, but Eric Harrer finally made me write this blog post by bringing up the topic once more at the Fediverse: https://phpc.social/@ErHaWeb/111096230843826340.
Read more about:
- TCE (TYPO3 Core engine) & DataHandler: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Typo3CoreEngine/Index.html
- Doctrine DBAL: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Database/Index.html
- Example Extension importing JSON data mapped to Objects using DataHandler in the end: https://git.daniel-siepmann.de/Customers/thuecat / https://github.com/werkraum-media/thuecat
- Example Extension importing JSON data mapped to Extbase Entities using mostly Extbase for importing: https://git.daniel-siepmann.de/Customers/events / https://github.com/werkraum-media/events
Julian Hofmann likes this.
like this
Daniel Siepmann reshared this.
Outgoing Webhooks in TYPO3
TYPO3 is an awesome CMS. On this page I share some of my snippets and examples that I consider shareworthy.Use TYPO3
AndreasKessel likes this.
AndreasKessel reshared this.
How to use CKEditor in a TYPO3 backend module - A TechBlog by Torben Hansen
A TechBlog by Torben HansenA TechBlog by Torben Hansen
My TYPO3 Journey
I'm a professional web developer doing PHP with TYPO3 since 2012. This post covers my journey from the beginning, how I've become a web developer and how I've become a TYPO3 developer and integrator. I'll also cover my experience back in the old days as a beginner and my current experience, covering my own history as well as TYPO3 history. I hope this will be useful for you, e.g. providing insights in how to become a web developer, how to get started with TYPO3 and how our job and technologies have changed over the years.
Florian Geierstanger likes this.
A blog about TYPO3 integration | Sebastian Klein, Web Developer
I can help you working with TYPO3 by offering: various templating extensions ✓ in-depth tutorials ✓ Best Practices ✓A blog about TYPO3 integration | Sebastian Klein, Web Developer
MarcusSchwemer likes this.
Auto migrate PHP code via configuration
We need to update software regularly. E.g. because our framework released a new major version containing breaking changes to APIs. It is a cumber stone and hard and boring task, not meant to be done by humans. Luckily we have computers and software we can use to automate boring tasks. Our example is about TYPO3 and Aimeos updates. TYPO3 is an open source CMS while Aimeos is an open source shop framework. I'll share my experience how to automate the boring tasks during one update and how to use the automation while upgrading further installations. We will check out rector and show how you can use existing rules with custom configuration to auto mate your code migrations.
https://daniel-siepmann.de/auto-migrate-php-code-via-configuration.html
Julian Hofmann likes this.
Missing Motivation to Blog
I find motivation crucial. It is the most important energy that drives us. Everyone has different motivations, but it is essential to every one of us. I currently lack motivation to write new blog posts. And I decided to write down my thoughts why I lack motivation and what actually motivates me. Maybe that will help some of you to learn from it regarding your own motivation.
Oliver Klee likes this.
Florian Geierstanger likes this.
Uwe Michelfelder reshared this.
TYPO3 table wizard limitations in TYPO3 11.5+ - A TechBlog by Torben Hansen
A TechBlog by Torben HansenA TechBlog by Torben Hansen
Florian Geierstanger likes this.
like this
Florian Geierstanger likes this.
TYPO3 show additional information in dropdown
https://daniel-siepmann.de/typo3-show-additional-information-in-dropdown.html
Florian Geierstanger likes this.
TYPO3 Fediverse News Accounts
https://daniel-siepmann.de/typo3-fediverse-news-accounts.html
https://friendica.daniel-siepmann.de/profile/typo3blogs/contacts/following lists all currently mirrored feeds.
reshared this
Julian Hofmann
•TYPO3 Blogs
MarcusSchwemer likes this.
Stephan Salzmann
•MarcusSchwemer
•1) Für einen Blog brauche ich kein CMS
2) Ich hatte schon eine teilweise Migration geschrieben. Posts und Bilder sind schon in T3. Kommentare fehlen aber noch ... und ein paar andere Features.
Letztendlich ist mit das Schreiben wichtiger, als die "richtige" Technologie dahinter. 🙂
Julian Hofmann
•@KaffDaddy