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
52 public function installCommand($extensionKey)
54 $this->emitPackagesMayHaveChangedSignal();
56 /** @var $service \TYPO3\CMS\Extensionmanager\Utility\InstallUtility */
57 $service = $this->objectManager
->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility
::class);
58 $service->install($extensionKey);
62 * Uninstalls an extension by key
64 * The extension files must be present in one of the
65 * recognised extension folder paths in TYPO3.
67 * @param string $extensionKey
69 public function uninstallCommand($extensionKey)
71 /** @var $service \TYPO3\CMS\Extensionmanager\Utility\InstallUtility */
72 $service = $this->objectManager
->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility
::class);
73 $service->uninstall($extensionKey);
77 * Updates class loading information.
79 * This command is only needed during development. The extension manager takes care
80 * creating or updating this info properly during extension (de-)activation.
82 public function dumpClassLoadingInformationCommand()
84 if (Environment
::isComposerMode()) {
85 $this->output
->outputLine('<error>Class loading information is managed by composer. Use "composer dump-autoload" command to update the information.</error>');
88 ClassLoadingInformation
::dumpClassLoadingInformation();
89 $this->output
->outputLine('Class Loading information has been updated.');
94 * Emits packages may have changed signal
96 protected function emitPackagesMayHaveChangedSignal()
98 $this->signalSlotDispatcher
->dispatch('PackageManagement', 'packagesMayHaveChanged');