‪TYPO3CMS  9.5
TYPO3\CMS\Form\Slot\FilePersistenceSlot Class Reference
Inheritance diagram for TYPO3\CMS\Form\Slot\FilePersistenceSlot:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

string getContentSignature (string $content)
 
 defineInvocation (string $command, bool $type=null)
 
bool allowInvocation (string $command, string $combinedFileIdentifier, string $contentSignature=null)
 
 onPreFileCreate (string $fileName, FolderInterface $targetFolder)
 
 onPreFileAdd (string $targetFileName, FolderInterface $targetFolder, string $sourceFilePath)
 
 onPreFileRename (FileInterface $file, string $targetFileName)
 
 onPreFileReplace (FileInterface $file, string $localFilePath)
 
 onPreFileMove (FileInterface $file, FolderInterface $targetFolder, string $targetFileName)
 
 onPreFileSetContents (FileInterface $file, $content=null)
 

Public Attributes

const COMMAND_FILE_ADD = 'fileAdd'
 
const COMMAND_FILE_CREATE = 'fileCreate'
 
const COMMAND_FILE_MOVE = 'fileMove'
 
const COMMAND_FILE_RENAME = 'fileRename'
 
const COMMAND_FILE_REPLACE = 'fileReplace'
 
const COMMAND_FILE_SET_CONTENTS = 'fileSetContents'
 

Protected Member Functions

 assertFileName (string $command, string $combinedFileIdentifier, string $content=null)
 
int null searchAllowedInvocation (string $command, string $combinedFileIdentifier, string $contentSignature=null)
 
string buildCombinedIdentifier (FolderInterface $folder, string $fileName)
 
bool isFormDefinition (string $identifier)
 
bool isRecycleFolder (FolderInterface $folder)
 

Protected Attributes

array $definedInvocations = array( )
 
array $allowedInvocations = array( )
 

Detailed Description

Definition at line 28 of file FilePersistenceSlot.php.

Member Function Documentation

◆ allowInvocation()

bool TYPO3\CMS\Form\Slot\FilePersistenceSlot::allowInvocation ( string  $command,
string  $combinedFileIdentifier,
string  $contentSignature = null 
)

Allows invocation for a particular combination of command and file identifier. Commands providing new content have have to submit a HMAC signature on the content as well.

Parameters
string$command
string$combinedFileIdentifier
string$contentSignature
Returns
‪bool
See also
getContentSignature

Definition at line 83 of file FilePersistenceSlot.php.

References TYPO3\CMS\Form\Slot\FilePersistenceSlot\searchAllowedInvocation().

◆ assertFileName()

◆ buildCombinedIdentifier()

◆ defineInvocation()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::defineInvocation ( string  $command,
bool  $type = null 
)

Defines invocations on command level only depending on the type:

  • ‪true: whitelist command, takes precedence over $allowedInvocations
  • ‪false: blacklist command, takes precedence over $allowedInvocations
  • ‪removes previously definition for particular command
Parameters
string$command
bool | null$type

Definition at line 64 of file FilePersistenceSlot.php.

◆ getContentSignature()

string TYPO3\CMS\Form\Slot\FilePersistenceSlot::getContentSignature ( string  $content)
Parameters
string$content
Returns
‪string

Definition at line 49 of file FilePersistenceSlot.php.

Referenced by TYPO3\CMS\Form\Slot\FilePersistenceSlot\assertFileName().

◆ isFormDefinition()

bool TYPO3\CMS\Form\Slot\FilePersistenceSlot::isFormDefinition ( string  $identifier)
protected

◆ isRecycleFolder()

bool TYPO3\CMS\Form\Slot\FilePersistenceSlot::isRecycleFolder ( FolderInterface  $folder)
protected

◆ onPreFileAdd()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileAdd ( string  $targetFileName,
FolderInterface  $targetFolder,
string  $sourceFilePath 
)

◆ onPreFileCreate()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileCreate ( string  $fileName,
FolderInterface  $targetFolder 
)
Parameters
string$fileName
FolderInterface$targetFolder

Definition at line 111 of file FilePersistenceSlot.php.

References TYPO3\CMS\Form\Slot\FilePersistenceSlot\assertFileName(), and TYPO3\CMS\Form\Slot\FilePersistenceSlot\buildCombinedIdentifier().

◆ onPreFileMove()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileMove ( FileInterface  $file,
FolderInterface  $targetFolder,
string  $targetFileName 
)

◆ onPreFileRename()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileRename ( FileInterface  $file,
string  $targetFileName 
)

◆ onPreFileReplace()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileReplace ( FileInterface  $file,
string  $localFilePath 
)

◆ onPreFileSetContents()

TYPO3\CMS\Form\Slot\FilePersistenceSlot::onPreFileSetContents ( FileInterface  $file,
  $content = null 
)

◆ searchAllowedInvocation()

int null TYPO3\CMS\Form\Slot\FilePersistenceSlot::searchAllowedInvocation ( string  $command,
string  $combinedFileIdentifier,
string  $contentSignature = null 
)
protected
Parameters
string$command
string$combinedFileIdentifier
string | null$contentSignature
Returns
‪int|null

Definition at line 290 of file FilePersistenceSlot.php.

Referenced by TYPO3\CMS\Form\Slot\FilePersistenceSlot\allowInvocation(), and TYPO3\CMS\Form\Slot\FilePersistenceSlot\assertFileName().

Member Data Documentation

◆ $allowedInvocations

array TYPO3\CMS\Form\Slot\FilePersistenceSlot::$allowedInvocations = array( )
protected

Definition at line 43 of file FilePersistenceSlot.php.

◆ $definedInvocations

array TYPO3\CMS\Form\Slot\FilePersistenceSlot::$definedInvocations = array( )
protected

Definition at line 39 of file FilePersistenceSlot.php.

◆ COMMAND_FILE_ADD

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_ADD = 'fileAdd'

◆ COMMAND_FILE_CREATE

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_CREATE = 'fileCreate'

◆ COMMAND_FILE_MOVE

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_MOVE = 'fileMove'

Definition at line 32 of file FilePersistenceSlot.php.

◆ COMMAND_FILE_RENAME

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_RENAME = 'fileRename'

◆ COMMAND_FILE_REPLACE

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_REPLACE = 'fileReplace'

Definition at line 34 of file FilePersistenceSlot.php.

◆ COMMAND_FILE_SET_CONTENTS

const TYPO3\CMS\Form\Slot\FilePersistenceSlot::COMMAND_FILE_SET_CONTENTS = 'fileSetContents'