Command Line Unification

CLI Diversity

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:

  1. 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)
  2. Deprecating and eventually removing CLI functionality built into Extbase (that is Request Handling, CommandControllers)
  3. Make EXT:scheduler take care of only scheduling and not creating tasks anymore.
  4. Write down migration paths for each of the previous use-cases

Impact

  • 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.

Possible Migrations

  • Add all features into EXT:core CLI
  • Proper documentation for migrating from Extbase Command Controllers and Scheduler Tasks to symfony/console

Pro

  • 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.

Con

  • Developers have to learn symfony/console when they want to do CLI based TYPO3 things.

Organizational

Topic Initiator: Benni Mack
Topic Mentor: Benni Mack

1 Like

yes to all of the above :slight_smile: let’s get this done.

Most important imho is the documentation part.

Big yes to create one way of doing things in this area in TYPO3.

I am always in favor of simpifiying things :slight_smile: I totally agree with @look about the
fundamental importance of documentation part.

This topic was automatically closed after 7 days. New replies are no longer allowed.