Repository navigation
Move mimetypes.list.php to config/mimetypemapping.dist.json - #17481
Conversation
This allows users to add new mimetypemappings (extention -> mimetype) themself. And not have to wait until a new release for updated mimetypes. Fixes: #15384
|
mmmm, we actually should make sure that this file does not get overwritten during an upgrade... else the user loses his additions... |
|
Isn't the config folder left untouched? I don't remember the instructions. If admins have to move the config, they can also move those json files. |
|
Perhaps we should support loading multiple files, e.g. Or do it the other way around - make the custom one Likewise for the other mimetype file of course. |
|
But otherwise this PR looks good 👍 |
|
Good call @Xenopathic. Makes it clear what is what. |
|
Interesting side note, oC actually loads any config files with the name |
|
Agreed lets use mimetypemapping.dist.json... let me fix that for this PR. And create a new one for the mimetypealiases.json |
|
Done :) |
There was a problem hiding this comment.
This needs to be phrased like a warning:
Any changes you make here will be overwritten on an update of ownCloud
Put any custom mappings in a new file mimetypemapping.json in this directory
This allows users to create their own mapping file to extend our current mappings. This makes sure that custom mappings are not lost on OC upgrades.
|
Nice! 👍 We need some documentation for this though. And do we want to ship a blank |
|
@Xenopathic I'd say it's an advanced feature and it shouldn't be too much to ask of an admin to create the file. |
|
Added todo issue for the docs. One more review guys :) |
There was a problem hiding this comment.
@rullzer Can you change this to \OC::$configDir?
There was a problem hiding this comment.
Ah didn't know about that one. Fixed!
|
A new inspection was created. |
There was a problem hiding this comment.
Actually, TBH I think the code looks better with those slashes there. PHP ignores multiple slashes (as does any UNIX utility), so we have no bug concerns, and it also means less effort if $configDir at some point loses the trailing slash.
TL;DR: leave the slashes, they're good 😄
|
👍 |
|
Mime type detection still works 👍 |
Move mimetypes.list.php to config/mimetypemapping.dist.json

This allows users to add new mimetypemappings (extention -> mimetype)
themself. And not have to wait until a new release for updated
mimetypes.
Fixes: #15384
CC: @oparoz @Xenopathic @MorrisJobke @PVince81 @DeepDiver1975