2 namespace TYPO3\CMS\Extensionmanager\Command
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 use TYPO3\CMS\Core\Core\ClassLoadingInformation
;
18 use TYPO3\CMS\Core\Core\Environment
;
19 use TYPO3\CMS\Extbase\Mvc\Controller\CommandController
;
22 * CommandController for working with extension management through CLI/scheduler
24 class ExtensionCommandController
extends CommandController
29 protected $requestAdminPermissions = true;
32 * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
34 protected $signalSlotDispatcher;
37 * @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
39 public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher
$signalSlotDispatcher)
41 $this->signalSlotDispatcher
= $signalSlotDispatcher;
45 * Installs an extension by key
47 * The extension files must be present in one of the
48 * recognised extension folder paths in TYPO3.
50 * @param string $extensionKey
53 public function installCommand($extensionKey)
55 $this->emitPackagesMayHaveChangedSignal();
57 /** @var $service \TYPO3\CMS\Extensionmanager\Utility\InstallUtility */
58 $service = $this->objectManager
->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility
::class);
59 $service->install($extensionKey);
63 * Uninstalls an extension by key
65 * The extension files must be present in one of the
66 * recognised extension folder paths in TYPO3.
68 * @param string $extensionKey
71 public function uninstallCommand($extensionKey)
73 /** @var $service \TYPO3\CMS\Extensionmanager\Utility\InstallUtility */
74 $service = $this->objectManager
->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility
::class);
75 $service->uninstall($extensionKey);
79 * Updates class loading information.
81 * This command is only needed during development. The extension manager takes care
82 * creating or updating this info properly during extension (de-)activation.
86 public function dumpClassLoadingInformationCommand()
88 if (Environment
::isComposerMode()) {
89 $this->output
->outputLine('<error>Class loading information is managed by composer. Use "composer dump-autoload" command to update the information.</error>');
92 ClassLoadingInformation
::dumpClassLoadingInformation();
93 $this->output
->outputLine('Class Loading information has been updated.');
98 * Emits packages may have changed signal
100 protected function emitPackagesMayHaveChangedSignal()
102 $this->signalSlotDispatcher
->dispatch('PackageManagement', 'packagesMayHaveChanged');