metasyntactical / symfony-mime
Helper component for hooking metasyntactical/mime into Symfony2 File Validation
Requires
- php: ~7.2|~7.3|~7.4|~8.0
- metasyntactical/mime: ^2.1.0
- symfony/filesystem: ~4.4.0|~5.0
- symfony/http-foundation: ^2.8.52|^3.4.34|~4.2.12|~4.3.8|^4.4|^5.0
- symfony/mime: ~4.4.0|~5.0
This package is auto-updated.
Last update: 2024-10-29 04:36:16 UTC
README
What is MetaSyntactical/symfony-mime?
MetaSyntactical/symfony-mime is a tie-in component to use the MetaSyntactical/Mime MIME type detection in Symfony2 File Validation.
Requirements
MetaSyntactical/symfony-mime is only supported on PHP 5.3.10 and up.
Installation
The best way to install MetaSyntactical/symfony-mime is to use Composer (http://getcomposer.org). Add the following part to your composer.json and run php composer.phar install`:
{
"require": {
"metasyntactical/symfony-mime": "dev-master"
}
}
Documentation
It is easy to add MIME type detection to Symfony2 File Validation. Just use the following code snippet (assuming you have installed MetaSyntactical/symfony-mime with composer):
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
use MetaSyntactical\Symfony\Component\HttpFoundation\File\MimeType\PhpMimeTypeGuesser;
MimeTypeGuesser::getInstance()->register(new PhpMimeTypeGuesser);
Afterwards the MetaSyntactical/Mime MIME type detection will be used in File's mimeType validation.
Contributing
COMING SOON MetaSyntactical/symfony-mime is an open source project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.