Sophron enhances Drupal's MIME type management. It significantly expands the number of recognized MIME types and file extensions, and offers an API for managing these definitions, optionally replacing Drupal's default MIME type guessing mechanism.
Sophron of Syracuse (Greek: Σώφρων ὁ Συρακούσιος, fl. 430 BC) was a writer of mimes. (Wikipedia)
Sophron of Drupal is a module to enhance MIME type management, based on the FileEye/MimeMap library.
Features
- Enhances Drupal's MIME type detection based on file extension to recognise 1200+ MIME types from 1600+ file extensions (vs Drupal's 360 MIME types and 475 file extensions).
- Provides an extensive MIME type management API through FileEye/MimeMap.
- Optionally replaces Drupal's core MIME type extension-based guesser.
Override Drupal core MIME type guessing
The Sophron module by itself just provides a service and an API for MIME type management. You can enable the complimentary Sophron guesser module to let Sophron manage the MIME type guessing, overriding Drupal core's guesser.
NOTE: The Sophron guesser module does not invoke the hook_file_mimetype_mapping_alter hook to allow altering the mapping of MIME types to file extensions. If you need to modify mappings, use the Sophron configuration UI to replicate any mapping changes.
Alternatively, modules can implement event subscribers that react to a Drupal\sophron\Event\MapEvent::INIT event that is fired when a map is initialised, and make the necessary changes to the mappings.
Ask your assistant about Sophron
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
1 tracked project depends on this one
- ImageMagick 40,973 sites
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.2.0 | Stable | 10–11 | Dec 17, 2024 | ||
| 2.2.x-dev | Dev | 10–11 | Dec 17, 2024 | ||
| 2.1.0 | Stable | 10–11 | Jun 10, 2024 | ||
| 2.1.0-rc2 | Pre-release | 10–11 | Jun 5, 2024 | ||
| 2.1.0-rc1 | Pre-release | 10–11 | May 18, 2024 | ||
| 2.1.x-dev | Dev | 10–11 | May 17, 2024 | ||
| 2.0.2 | Stable | 10 | Nov 12, 2023 | ||
| 2.0.1 | Stable | 10 | Feb 13, 2023 |