‪TYPO3CMS  ‪main
TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController Class Reference
Inheritance diagram for TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController:
TYPO3\CMS\Extensionmanager\Controller\AbstractController TYPO3\CMS\Core\Security\BlockSerializationTrait TYPO3\CMS\Extbase\Mvc\Controller\ActionController TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface

Public Member Functions

 __construct (protected readonly FileHandlingUtility $fileHandlingUtility, protected readonly ExtensionManagementService $managementService, protected readonly ExtensionConfiguration $extensionConfiguration,)
 
 __destruct ()
 
 formAction ()
 
 extractAction (bool $overwrite=false)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extensionmanager\Controller\AbstractController
 injectModuleTemplateFactory (ModuleTemplateFactory $moduleTemplateFactory)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 injectResponseFactory (ResponseFactoryInterface $responseFactory)
 
 injectStreamFactory (StreamFactoryInterface $streamFactory)
 
 injectConfigurationManager (ConfigurationManagerInterface $configurationManager)
 
 injectValidatorResolver (ValidatorResolver $validatorResolver)
 
 injectViewResolver (ViewResolverInterface $viewResolver)
 
 injectReflectionService (ReflectionService $reflectionService)
 
 injectHashService (HashService $hashService)
 
 injectMvcPropertyMappingConfigurationService (MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService)
 
 injectEventDispatcher (EventDispatcherInterface $eventDispatcher)
 
 injectPropertyMapper (PropertyMapper $propertyMapper)
 
 injectInternalFlashMessageService (FlashMessageService $flashMessageService)
 
 injectInternalExtensionService (ExtensionService $extensionService)
 
 initializeControllerArgumentsBaseValidators ()
 
 processRequest (RequestInterface $request)
 
 addFlashMessage (string $messageBody, string $messageTitle='', ContextualFeedbackSeverity $severity=ContextualFeedbackSeverity::OK, bool $storeInSession=true)
 
 throwStatus (int $statusCode, string $statusMessage='', ?string $content=null)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Security\BlockSerializationTrait
 __wakeup ()
 

Protected Member Functions

 checkFileName ($fileName)
 
 activateExtension (string $extensionKey)
 
 extractExtensionFromZipFile (string $uploadedFile, string $extensionKey, bool $overwrite=false)
 
string getExtensionKeyFromFileName (string $fileName)
 
 copyExtensionFolderToTempFolder (string $extensionKey)
 
 removeExtensionAndRestoreFromBackup (string $fileName)
 
 removeBackupFolder ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Extensionmanager\Controller\AbstractController
 translate (string $key, ?array $arguments=null)
 
 handleTriggerArguments (ModuleTemplate $view)
 
 initializeModuleTemplate (RequestInterface $request)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 initializeAction ()
 
 initializeActionMethodArguments ()
 
 initializeActionMethodValidators ()
 
 renderAssetsForRequest (RequestInterface $request)
 
 resolveActionMethodName ()
 
 callActionMethod (RequestInterface $request)
 
 resolveView ()
 
 setViewConfiguration (ViewInterface $view)
 
 errorAction ()
 
 addErrorFlashMessage ()
 
 getErrorFlashMessage ()
 
 forwardToReferringRequest ()
 
 getFlattenedValidationErrorMessage ()
 
 getFlashMessageQueue (string $identifier=null)
 
 redirect (?string $actionName, ?string $controllerName=null, ?string $extensionName=null, ?array $arguments=null, ?int $pageUid=null, $_=null, int $statusCode=303)
 
 redirectToUri (string|UriInterface $uri, $_=null, int $statusCode=303)
 
 addBaseUriIfNecessary (string $uri)
 
 mapRequestArgumentsToControllerArguments ()
 
 htmlResponse (string $html=null)
 
 jsonResponse (string $json=null)
 

Protected Attributes

string $extensionBackupPath = ''
 
bool $removeFromOriginalPath = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extensionmanager\Controller\AbstractController
ModuleTemplateFactory $moduleTemplateFactory
 
array $triggerArguments
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
ResponseFactoryInterface $responseFactory
 
StreamFactoryInterface $streamFactory
 
HashService $hashService
 
ReflectionService $reflectionService
 
ViewInterface $view
 
string $defaultViewObjectName = TemplateView::class
 
string $actionMethodName = 'indexAction'
 
string $errorMethodName = 'errorAction'
 
MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
 
EventDispatcherInterface $eventDispatcher
 
RequestInterface $request
 
UriBuilder $uriBuilder
 
array $settings
 
ValidatorResolver $validatorResolver
 
Arguments $arguments
 
ConfigurationManagerInterface $configurationManager
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Extensionmanager\Controller\AbstractController
const TRIGGER_RefreshModuleMenu = 'refreshModuleMenu'
 
const TRIGGER_RefreshTopbar = 'refreshTopbar'
 

Detailed Description

Controller for handling upload of a .zip file which is then placed as an extension.

This class is a specific controller implementation and is not considered part of the Public TYPO3 API.

Definition at line 36 of file UploadExtensionFileController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::__construct ( protected readonly FileHandlingUtility  $fileHandlingUtility,
protected readonly ExtensionManagementService  $managementService,
protected readonly ExtensionConfiguration  $extensionConfiguration 
)

Definition at line 42 of file UploadExtensionFileController.php.

◆ __destruct()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::__destruct ( )

Remove backup folder before destruction

Definition at line 51 of file UploadExtensionFileController.php.

References TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\removeBackupFolder().

Member Function Documentation

◆ activateExtension()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::activateExtension ( string  $extensionKey)
protected

◆ checkFileName()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::checkFileName (   $fileName)
protected

Validate the filename of an uploaded file

Parameters
string$fileName
Exceptions
InvalidFileException

Definition at line 155 of file UploadExtensionFileController.php.

Referenced by TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction().

◆ copyExtensionFolderToTempFolder()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::copyExtensionFolderToTempFolder ( string  $extensionKey)
protected

◆ extractAction()

◆ extractExtensionFromZipFile()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::extractExtensionFromZipFile ( string  $uploadedFile,
string  $extensionKey,
bool  $overwrite = false 
)
protected

Extracts a given zip file and installs the extension

Parameters
string$uploadedFile‪Path to uploaded file
bool$overwrite‪Overwrite existing extension if TRUE
Exceptions
ExtensionManagerException

Definition at line 180 of file UploadExtensionFileController.php.

References TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\copyExtensionFolderToTempFolder().

Referenced by TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction().

◆ formAction()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::formAction ( )

◆ getExtensionKeyFromFileName()

string TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::getExtensionKeyFromFileName ( string  $fileName)
protected

As there is no information about the extension key in the zip we have to use the file name to get that information filename format is expected to be extensionkey_version.zip. Removes version and file extension from filename to determine extension key

Parameters
string$fileName
Returns
‪string

Definition at line 203 of file UploadExtensionFileController.php.

Referenced by TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction(), and TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\removeExtensionAndRestoreFromBackup().

◆ removeBackupFolder()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::removeBackupFolder ( )
protected

◆ removeExtensionAndRestoreFromBackup()

TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::removeExtensionAndRestoreFromBackup ( string  $fileName)
protected

Member Data Documentation

◆ $extensionBackupPath

string TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::$extensionBackupPath = ''
protected

Definition at line 39 of file UploadExtensionFileController.php.

◆ $removeFromOriginalPath

bool TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController::$removeFromOriginalPath = false
protected

Definition at line 40 of file UploadExtensionFileController.php.