diff --git a/typo3/cli_dispatch.phpsh b/typo3/cli_dispatch.phpsh index 7b8acac0ed63fb6910a6241070f01b6bc9317910..57817392a7ca60af006bf8d609f3cbae308d2025 100755 --- a/typo3/cli_dispatch.phpsh +++ b/typo3/cli_dispatch.phpsh @@ -1,4 +1,5 @@ #!/usr/bin/env php <?php - +// This entry-point is deprecated since TYPO3 v8 and will be removed in TYPO3 v9 +// Use the binary located typo3/sysext/core/bin/typo3 instead. require 'sysext/backend/Resources/Private/Php/cli.php'; diff --git a/typo3/sysext/backend/Classes/Console/Application.php b/typo3/sysext/backend/Classes/Console/Application.php index cc52d82836c80aee88aa172bfb63dbabdfd2435b..edc09321a42b5e2b24a9daa873209b1e0e3df951 100644 --- a/typo3/sysext/backend/Classes/Console/Application.php +++ b/typo3/sysext/backend/Classes/Console/Application.php @@ -18,6 +18,10 @@ use TYPO3\CMS\Core\Core\Bootstrap; /** * Entry point for the TYPO3 Command Line for Backend calls + * + * This class is @deprecated in favor of the Core-based CommandApplication, which has a different + * entry-point level, and has a different request handler out-of-the-box. This class will be removed + * in TYPO3 v9. */ class Application implements ApplicationInterface { diff --git a/typo3/sysext/backend/Classes/Console/CliRequestHandler.php b/typo3/sysext/backend/Classes/Console/CliRequestHandler.php index 6218dcfb181e93c9c50e2981d34f0e1c94ba6ed1..a623bde425c673a431047585c619cfaf3ac22e11 100644 --- a/typo3/sysext/backend/Classes/Console/CliRequestHandler.php +++ b/typo3/sysext/backend/Classes/Console/CliRequestHandler.php @@ -27,6 +27,8 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * Resolves the "cliKey" which is registered inside $TYPO3_CONF_VARS[SC_OPTIONS][GLOBAL][cliKeys] * and includes the CLI-based script or exits if no valid "cliKey" is found. * Also logs into the system as a backend user which needs to be added to the database called _CLI_mymodule + * + * This class is deprecated in favor of the Core-based CommandRequestHandler, which uses Symfony Commands. */ class CliRequestHandler implements RequestHandlerInterface { @@ -54,6 +56,8 @@ class CliRequestHandler implements RequestHandlerInterface */ public function handleRequest(InputInterface $input) { + GeneralUtility::deprecationLog('Using cli_dispatch.phpsh as entry point for CLI commands has been marked ' + . 'as deprecated and will be removed in TYPO3 v9. Please use the new CLI entrypoint via /typo3/sysext/core/bin/typo3 instead.'); $output = GeneralUtility::makeInstance(ConsoleOutput::class); $exitCode = 0; diff --git a/typo3/sysext/backend/Resources/Private/Php/cli.php b/typo3/sysext/backend/Resources/Private/Php/cli.php index b5412ec3ed92310a94461ae8511de302ca817026..925c6c66454edbac4ff49b8e8ab3fbf16950033e 100644 --- a/typo3/sysext/backend/Resources/Private/Php/cli.php +++ b/typo3/sysext/backend/Resources/Private/Php/cli.php @@ -18,6 +18,10 @@ if (version_compare(PHP_VERSION, '7.0.0', '<')) { } /** + * -------------------------------------------------------------------------------- + * NOTE: This entry-point is deprecated since TYPO3 v8 and will be removed in + * TYPO3 v9. Use the binary located typo3/sysext/core/bin/typo3 instead. + * -------------------------------------------------------------------------------- * Command Line Interface module dispatcher * * This script takes a "cliKey" as first argument and uses that to dispatch diff --git a/typo3/sysext/core/Classes/Console/CommandRequestHandler.php b/typo3/sysext/core/Classes/Console/CommandRequestHandler.php index d3eb7a4eb434b02a24fc9985f573dd22ba23a967..27070f90a23fe16d2fee5edf30ed6a12be41b518 100644 --- a/typo3/sysext/core/Classes/Console/CommandRequestHandler.php +++ b/typo3/sysext/core/Classes/Console/CommandRequestHandler.php @@ -74,8 +74,10 @@ class CommandRequestHandler implements RequestHandlerInterface $command = $this->getCommandToRun($input); if (!$command) { + // Using old "cliKeys" is marked as deprecated and will be removed in TYPO3 v9 $cliKeys = array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']); + $output->writeln('Using old "cliKeys" ($GLOBALS[TYPO3_CONF_VARS][SC_OPTIONS][GLOBAL][cliKeys]) is marked as deprecated and will be removed in TYPO3 v9:'); $output->writeln('Old entrypoint keys available:'); asort($cliKeys); foreach ($cliKeys as $key => $value) { diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index eedcc064355978e13b0652cc7d189421e1911914..037c6a4b8db135934b2238af28f1e649fd971e7e 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -1064,6 +1064,7 @@ return [ 'email' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class, 'url' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class, ], + // cliKeys have been deprecated and will be removed in TYPO3 v9 'cliKeys' => [] ], ], diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80468-CommandLineInterfaceCliKeysAndCli_dispatchphpsh.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80468-CommandLineInterfaceCliKeysAndCli_dispatchphpsh.rst new file mode 100644 index 0000000000000000000000000000000000000000..78452471edc47489dd45a9923e735467aff6f58e --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80468-CommandLineInterfaceCliKeysAndCli_dispatchphpsh.rst @@ -0,0 +1,48 @@ +.. include:: ../../Includes.txt + +============================================================================ +Deprecation: #80468 - Command Line Interface: cliKeys and cli_dispatch.phpsh +============================================================================ + +See :issue:`80468` + +Description +=========== + +The functionality to register any command line script via php``$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['my_extension']`` has been marked as deprecated. + +The entrypoint ``typo3/cli_dispatch.phpsh`` as well as the corresponding Application class and +the CliRequestHandler class have been marked as deprecated as well. + +The functionality has been superseded by Symfony Console and the new entry-point within +``typo3/sysext/core/bin/typo3`` which is able to handle all functionality the same way including +all Extbase-related Command Controllers. + + +Impact +====== + +Calling the CLI entrypoint ``typo3/cli_dispatch.phpsh`` to call a CLI script will trigger a +deprecation warning. + + +Affected Installations +====================== + +Any installation using ``typo3/cli_dispatch.phpsh`` in any deployment or cronjob / scheduler +functionality. + + +Migration +========= + +All functionality related to Extbase, EXT:lowlevel, or scheduler tasks can be called via +the new entrypoint ``typo3/sysext/core/bin/typo3`` with a similar call. + +Update all cronjobs and automated and manual running scripts called via the command line to use +the new entrypoint. + +If there any custom cliKeys registered, migrate them to a Symfony Command or an Extbase Command +Controller. + +.. index:: CLI \ No newline at end of file diff --git a/typo3/sysext/extbase/ext_localconf.php b/typo3/sysext/extbase/ext_localconf.php index 70b69a9fe43ea1761434d37e0d6efd1fa6aeb2b7..048fa541126c40c6f8466ac00936a51126a0d821 100644 --- a/typo3/sysext/extbase/ext_localconf.php +++ b/typo3/sysext/extbase/ext_localconf.php @@ -33,6 +33,7 @@ unset($extbaseObjectContainer); if (TYPO3_MODE === 'BE') { // registers Extbase at the cli_dispatcher with key "extbase". + // Using cliKeys is deprecated as of TYPO3 v8 and will be removed in TYPO3 v9, use Configuration/Commands.php instead $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['extbase'] = [ function () { $bootstrap = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Core\Bootstrap::class); diff --git a/typo3/sysext/lowlevel/ext_localconf.php b/typo3/sysext/lowlevel/ext_localconf.php index 8f892b0d8beb56f71c3e6148625b514486c7f81b..397b28084a36d14a5364e1627f54cf505c4d9541 100644 --- a/typo3/sysext/lowlevel/ext_localconf.php +++ b/typo3/sysext/lowlevel/ext_localconf.php @@ -3,6 +3,7 @@ defined('TYPO3_MODE') or die(); if (TYPO3_MODE === 'BE') { // Setting up scripts that can be run from the cli_dispatch.phpsh script. + // Using cliKeys is deprecated as of TYPO3 v8 and will be removed in TYPO3 v9, use Configuration/Commands.php instead $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['lowlevel_cleaner'] = [ function () { $cleanerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Lowlevel\CleanerCommand::class); diff --git a/typo3/sysext/scheduler/ext_localconf.php b/typo3/sysext/scheduler/ext_localconf.php index 50614a053d489b441f1c2ecf56ea8b6783f5ac41..6f748032aaef3a6201b4b669a084b90489a11207 100644 --- a/typo3/sysext/scheduler/ext_localconf.php +++ b/typo3/sysext/scheduler/ext_localconf.php @@ -2,6 +2,7 @@ defined('TYPO3_MODE') or die(); // Register the Scheduler as a possible key for CLI calls +// Using cliKeys is deprecated as of TYPO3 v8 and will be removed in TYPO3 v9, use Configuration/Commands.php instead $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['scheduler'] = [ function ($input, $output) { $app = new \Symfony\Component\Console\Application('TYPO3 Scheduler', TYPO3_version);