‪TYPO3CMS  10.4
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 {
26 
30  public function ‪beforeAddSysFileRecordOnImport(array $params): void
31  {
32  $fileRecord = $params['fileRecord'];
33  $temporaryFile = $params['temporaryFile'];
34 
35  $formPersistenceSlot = GeneralUtility::makeInstance(FilePersistenceSlot::class);
36  $formPersistenceSlot->allowInvocation(
38  implode(':', [$fileRecord['storage'], $fileRecord['identifier']]),
39  $formPersistenceSlot->getContentSignature(file_get_contents($temporaryFile))
40  );
41  }
42 }
‪TYPO3\CMS\Form\Slot\FilePersistenceSlot\COMMAND_FILE_ADD
‪const COMMAND_FILE_ADD
Definition: FilePersistenceSlot.php:39
‪TYPO3\CMS\Form\Hooks\ImportExportHook\beforeAddSysFileRecordOnImport
‪beforeAddSysFileRecordOnImport(array $params)
Definition: ImportExportHook.php:30
‪TYPO3\CMS\Form\Hooks
Definition: DataStructureIdentifierHook.php:18
‪TYPO3\CMS\Form\Slot\FilePersistenceSlot
Definition: FilePersistenceSlot.php:38
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Form\Hooks\ImportExportHook
Definition: ImportExportHook.php:25