‪TYPO3CMS  11.5
ImportExportHook.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
16 namespace ‪TYPO3\CMS\Form\Hooks;
17 
20 
25 {
29  public function ‪beforeAddSysFileRecordOnImport(array $params): void
30  {
31  $fileRecord = $params['fileRecord'];
32  $temporaryFile = $params['temporaryFile'];
33 
34  $formPersistenceSlot = GeneralUtility::makeInstance(FilePersistenceSlot::class);
35  $formPersistenceSlot->allowInvocation(
37  implode(':', [$fileRecord['storage'], $fileRecord['identifier']]),
38  $formPersistenceSlot->getContentSignature(file_get_contents($temporaryFile))
39  );
40  }
41 }
‪TYPO3\CMS\Form\Slot\FilePersistenceSlot\COMMAND_FILE_ADD
‪const COMMAND_FILE_ADD
Definition: FilePersistenceSlot.php:38
‪TYPO3\CMS\Form\Hooks\ImportExportHook\beforeAddSysFileRecordOnImport
‪beforeAddSysFileRecordOnImport(array $params)
Definition: ImportExportHook.php:29
‪TYPO3\CMS\Form\Hooks
Definition: DataStructureIdentifierHook.php:18
‪TYPO3\CMS\Form\Slot\FilePersistenceSlot
Definition: FilePersistenceSlot.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Form\Hooks\ImportExportHook
Definition: ImportExportHook.php:25