Add context. Upgrade dependencies.
Full Changelog: https://github.com/Warxcell/files/compare/5.1.4...6.0.0
Full Changelog: https://github.com/Warxcell/files/compare/5.1.3...5.1.4
This release introduces Storage and removes hard-dependency on FlySystem. This opens new possibilities. You can still use FlySystem throught adapter: $storage = new \Arxy\FilesBundle\Storage\FlysystemStorage($flysystem);
Other changes:
Removes SymfonyCachePathResolver. Replaced by CachePathResolver which uses PSR-16 Cache.
Changelog:
writeStream is removed, write now accepts SplFileInfo as second argument.RuntimeExtension for Twig Extensions.This version comes with a lot of refactoring, removals and new features:
CHANGELOG.
Entity\MutableFile. It contains additional field modifiedAt.ManagerInterface::refresh(File)RefreshDatabaseCommandwrite(MutableFile $file, string $contents) and writeStream(MutableFile $file, resource $resource)md5Hash to just hash. This will allows usage of any hashing algotithm. (Sha1, sha256, etc.)fileSize to just size.Model\DecoratedFile which eases decorating file.ModelFactory which is responsible for instantiating File objects when uploading new file.UPGRADE:
getMd5Hash to getHash. Rename queries from property md5Hash to hashgetFileSize to getSize. Rename queries from property fileSize to size.Manager now accepts arguments in different order. If you are not using named arguments - please take a look and update them.Psr\EventDispatcher\EventDispatcherInterface - please pass it in order to use Events. (If using Symfony Autowire, nothing to do).Changelog:
DelegatingManager which allows fluent usage of ManagerInterface for read operations with more than 1 file entity.manager on FileType form, which will allow usage of different ManagerInterface instance when having more than 1 file entity.Manager which accepts League\MimeTypeDetection\MimeTypeDetector\MimeTypeDetector, which are used to detect mime types.AzureBlobStoragePathResolver.DelegatingPathResolver which allows using of multiple file entities with different path resolvers.Arxy\FilesBundle\Repository\ORMTrait which can be used on ORM Repositories.file_content filter for Twig which returns contents of file.public function clear(): void; on ManagerInterface which clears temporary files map.Support Doctrine/Persistence ^2.1
Files is now supporting FlySystem V2. https://flysystem.thephpleague.com/v2/docs/what-is-new/
New features: PathResolvers - Transforms Files to web browser path. Few built-in resolvers exists as per this release:
DirectoryPrefixStrategy - decorator that prefixes directory.
BC Breaks: getDirectory() in NamingStrategy is now optional. Return type should be now ?string. FileType form now uses internally 'file' field to handle files, instead extending FileType. This allows you to add custom fields for Files in forms.
$formMapper->add(
'image',
FileType::class,
[
'required' => false,
'constraints' => [ConstraintsOnEntity]
'input_options' => [
'attr' => [
'accept' => 'image/*',
],
'constraints' => [
SymfonyConstraintsOnFiles
]
],
]
);
Introduces ManagerInterface - from now on use this interface for type-hints.
Also add translations to Form Theme.
Also bump PHP to ^7.4, because of added typehinting of class variables.
How can I help you explore Laravel packages today?