first commit

This commit is contained in:
salam committed 2026-10-19 08:18:39 +02:00
commit 1218dd1517
12716 files changed
+989233

No files matched your search

@@ -0,0 +1,73 @@
<?php
declare(strict_types = 1);
namespace TYPO3\CMS\Extensionmanager\Command;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
/**
* Command for activating an existing extension via CLI.
*/
class ActivateExtensionCommand extends Command
{
/**
* Defines the allowed options for this command
*/
protected function configure()
{
$this
->setDescription('Activates an extension by key')
->setHelp('The extension files must be present in one of the recognized extension folder paths in TYPO3.')
->setAliases(['extensionmanager:extension:install', 'extension:install'])
->addArgument(
'extensionkey',
InputArgument::REQUIRED,
'The extension key of a currently deactivated extension, located in one of TYPO3\'s extension paths.'
);
}
/**
* Installs an extension
*
* @inheritdoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$extensionKey = $input->getArgument('extensionkey');
// Ensure the _cli_ user is authenticated because the extension might import data
Bootstrap::initializeBackendAuthentication();
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
// Emits packages may have changed signal
$signalSlotDispatcher = $objectManager->get(Dispatcher::class);
$signalSlotDispatcher->dispatch('PackageManagement', 'packagesMayHaveChanged');
// Do the installation process
$objectManager->get(InstallUtility::class)->install($extensionKey);
$io->success('Activated extension ' . $extensionKey . ' successfully.');
}
}
@@ -0,0 +1,62 @@
<?php
declare(strict_types = 1);
namespace TYPO3\CMS\Extensionmanager\Command;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
/**
* Command for deactivating an extension via CLI.
*/
class DeactivateExtensionCommand extends Command
{
/**
* Defines the allowed options for this command
*/
protected function configure()
{
$this
->setDescription('Deactivates an extension by extension key')
->setAliases(['extensionmanager:extension:uninstall', 'extension:uninstall'])
->addArgument(
'extensionkey',
InputArgument::REQUIRED,
'The extension key of a currently activated extension.'
);
}
/**
* Installs an extension
*
* @inheritdoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$extensionKey = $input->getArgument('extensionkey');
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$objectManager->get(InstallUtility::class)->uninstall($extensionKey);
$io->success('Deactivated extension "' . $extensionKey . '" successfully.');
}
}
@@ -0,0 +1,112 @@
<?php
namespace TYPO3\CMS\Extensionmanager\Command;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Core\ClassLoadingInformation;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
/**
* CommandController for working with extension management through CLI/scheduler
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Use Symfony Command alternatives instead.
*/
class ExtensionCommandController extends CommandController
{
/**
* @var bool
*/
protected $requestAdminPermissions = true;
/**
* @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
*/
protected $signalSlotDispatcher;
/**
* @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
*/
public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
{
$this->signalSlotDispatcher = $signalSlotDispatcher;
}
/**
* Installs an extension by key
*
* The extension files must be present in one of the
* recognised extension folder paths in TYPO3.
*
* @param string $extensionKey
* @cli
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Use the equivalent Symfony Command instead.
*/
public function installCommand($extensionKey)
{
trigger_error('Calling ExtensionCommandController->installCommand() will be removed in TYPO3 v10.0. Use the Symfony command "extension:activate" instead, to be called via the "typo3" CLI entrypoint.', E_USER_DEPRECATED);
$this->emitPackagesMayHaveChangedSignal();
/** @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $service */
$service = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class);
$service->install($extensionKey);
}
/**
* Uninstalls an extension by key
*
* The extension files must be present in one of the
* recognised extension folder paths in TYPO3.
*
* @param string $extensionKey
* @cli
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Use the equivalent Symfony Command instead.
*/
public function uninstallCommand($extensionKey)
{
trigger_error('Calling ExtensionCommandController->uninstallCommand() will be removed in TYPO3 v10.0. Use the Symfony command "extension:deactivate" instead, to be called via the "typo3" CLI entrypoint.', E_USER_DEPRECATED);
/** @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $service */
$service = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class);
$service->uninstall($extensionKey);
}
/**
* Updates class loading information.
*
* This command is only needed during development. The extension manager takes care
* creating or updating this info properly during extension (de-)activation.
*
* @cli
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Use the equivalent Symfony Command instead.
*/
public function dumpClassLoadingInformationCommand()
{
trigger_error('Calling ExtensionCommandController->dumpClassLoadingInformationCommand() will be removed in TYPO3 v10.0. Use the Symfony command "dumpautoload" instead, to be called via the "typo3" CLI entrypoint.', E_USER_DEPRECATED);
if (Environment::isComposerMode()) {
$this->output->outputLine('<error>Class loading information is managed by composer. Use "composer dump-autoload" command to update the information.</error>');
$this->quit(1);
} else {
ClassLoadingInformation::dumpClassLoadingInformation();
$this->output->outputLine('Class Loading information has been updated.');
}
}
/**
* Emits packages may have changed signal
*/
protected function emitPackagesMayHaveChangedSignal()
{
$this->signalSlotDispatcher->dispatch('PackageManagement', 'packagesMayHaveChanged');
}
}