FileResolutionStrategy
interface FileResolutionStrategy (View source)
Represents a strategy for resolving files on a Flysystem Adapter.
Methods
Try to resolve a file ID against the provided Filesystem.
Try to resolve a file ID against the provided Filesystem looking at newer versions of the file.
Build a file ID for a variant so it follows the pattern of its original file. The variant may not exist on the Filesystem yet, but the original file has to. This is to make sure that variant files always follow the same pattern as the original file they are attached to.
Try to find a file ID for an existing file using the provided file tuple.
Build a file ID for the provided tuple, irrespective of its existence.
Try to resolve the provided file ID string irrespective of whether it exists on the Filesystem or not.
Find all the variants of the provided tuple
Normalise a filename to be consistent with this file resolution strategy.
Given a fileID string or a Parsed File ID, create a matching ParsedFileID without any variant.
Details
ParsedFileID|null
resolveFileID(string $fileID, Filesystem $filesystem)
Try to resolve a file ID against the provided Filesystem.
ParsedFileID|null
softResolveFileID(string $fileID, Filesystem $filesystem)
Try to resolve a file ID against the provided Filesystem looking at newer versions of the file.
ParsedFileID
generateVariantFileID(ParsedFileID|array $tuple, Filesystem $filesystem)
Build a file ID for a variant so it follows the pattern of its original file. The variant may not exist on the Filesystem yet, but the original file has to. This is to make sure that variant files always follow the same pattern as the original file they are attached to.
ParsedFileID|null
searchForTuple(array|ParsedFileID $tuple, Filesystem $filesystem, bool $strict = true)
Try to find a file ID for an existing file using the provided file tuple.
string
buildFileID(array|ParsedFileID $tuple)
Build a file ID for the provided tuple, irrespective of its existence.
Should always return the preferred file ID for this resolution strategy.
ParsedFileID
parseFileID($fileID)
Try to resolve the provided file ID string irrespective of whether it exists on the Filesystem or not.
generator|ParsedFileID[]|null
findVariants(array|ParsedFileID $tuple, Filesystem $filesystem)
Find all the variants of the provided tuple
string
cleanFilename(string $filename)
Normalise a filename to be consistent with this file resolution strategy.
ParsedFileID|null
stripVariant(string|ParsedFileID $fileID)
Given a fileID string or a Parsed File ID, create a matching ParsedFileID without any variant.