TYPO3 Core has CommandControllers for Extbase, and since TYPO3 v8.0, it ships with symfony/console commands which actually replaced various issues related to a mixed TYPO3_MODE, various registration scripts, and cli_dispatch.phpsh, and permission handling (one single cli user automatically created).
So, although the legacy CommandLineController was removed in TYPO3 v9, it is still unclear when to use which form of tool, as both have their drawbacks, mainly in terms of developer convenience (feedback to me that “Extbase Command Controller was easier” from a few people), maintenance and conceptual issues regarding to Extbase DI (see dozens of issues in issue tracker regarding that.
I wrote down a list of difference between the approaches, and EXT:scheduler tasks came to my mind as well, which could be used to write CLI tools as well. See https://forge.typo3.org/issues/85990
All three variants are used throughout core, and the biggest downside from an experience PoV is that there is no clear approach for an ext developer when to use what.
That’s why I suggest the following:
- Fully implement or document all functionality necessary to get “the job done” in TYPO3’s symfony/console integration. (the Epic above could start as a good base point to write down the missing points)
- Deprecating and eventually removing CLI functionality built into Extbase (that is Request Handling, CommandControllers)
- Make EXT:scheduler take care of only scheduling and not creating tasks anymore.
- Write down migration paths for each of the previous use-cases
- EXT:scheduler functionality will be streamlined and some very ugly hacks will get reduced (like serialized objects, as the command name and arguments should be sufficient to be stored in the database).
- EXT:extbase will be simplified by not having to worry about a CLI-based request dispatching anymore
- EXT:extbase could get a proper API for handling extbase-related functionality on CLI (like Persistence and ConfigurationManagement) for developers to explicitly define these parts (like “–pid” for take the Extbase configuration from this page ID)
- documented and streamlined usages for core developers and extension authors.
- Add all features into EXT:core CLI
- Proper documentation for migrating from Extbase Command Controllers and Scheduler Tasks to symfony/console
- Developers familiar with symfony/console can start writing away within minutes.
- Developers might like TYPO3 better due to doing some thing just “one way” instead of multiple ways.
- Developers have to learn symfony/console when they want to do CLI based TYPO3 things.
Topic Initiator: Benni Mack
Topic Mentor: Benni Mack