‪TYPO3CMS  ‪main
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  public function ‪beforeAddSysFileRecordOnImport(array $params): void
27  {
28  $fileRecord = $params['fileRecord'];
29  $temporaryFile = $params['temporaryFile'];
30 
31  $filePersistenceSlot = GeneralUtility::makeInstance(FilePersistenceSlot::class);
32  $filePersistenceSlot->allowInvocation(
34  implode(':', [$fileRecord['storage'], $fileRecord['identifier']]),
35  $filePersistenceSlot->getContentSignature(file_get_contents($temporaryFile))
36  );
37  }
38 }
‪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:26
‪TYPO3\CMS\Form\Hooks
Definition: FormElementHooks.php:16
‪TYPO3\CMS\Form\Slot\FilePersistenceSlot
Definition: FilePersistenceSlot.php:38
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Form\Hooks\ImportExportHook
Definition: ImportExportHook.php:25