‪TYPO3CMS  10.4
DeactivateExtensionCommand.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\Console\Command\Command;
21 use Symfony\Component\Console\Input\InputArgument;
22 use Symfony\Component\Console\Input\InputInterface;
23 use Symfony\Component\Console\Output\OutputInterface;
24 use Symfony\Component\Console\Style\SymfonyStyle;
28 
32 class ‪DeactivateExtensionCommand extends Command
33 {
37  protected function ‪configure()
38  {
39  $this
40  ->setDescription('Deactivates an extension by extension key')
41  ->setAliases(['extensionmanager:extension:uninstall', 'extension:uninstall'])
42  ->addArgument(
43  'extensionkey',
44  InputArgument::REQUIRED,
45  'The extension key of a currently activated extension.'
46  );
47  }
48 
54  protected function ‪execute(InputInterface $input, OutputInterface ‪$output)
55  {
56  $io = new SymfonyStyle($input, ‪$output);
57  $extensionKey = $input->getArgument('extensionkey');
58 
59  $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
60  $objectManager->get(InstallUtility::class)->uninstall($extensionKey);
61 
62  $io->success('Deactivated extension "' . $extensionKey . '" successfully.');
63  return 0;
64  }
65 }
‪TYPO3\CMS\Extensionmanager\Command\DeactivateExtensionCommand\configure
‪configure()
Definition: DeactivateExtensionCommand.php:37
‪TYPO3\CMS\Extensionmanager\Command\DeactivateExtensionCommand
Definition: DeactivateExtensionCommand.php:33
‪TYPO3\CMS\Extensionmanager\Utility\InstallUtility
Definition: InstallUtility.php:55
‪TYPO3\CMS\Extensionmanager\Command
Definition: ActivateExtensionCommand.php:18
‪$output
‪$output
Definition: annotationChecker.php:119
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:28
‪TYPO3\CMS\Extensionmanager\Command\DeactivateExtensionCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: DeactivateExtensionCommand.php:54