-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Introduce mimetype DB update occ command #18742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
good idea 👍 |
👍 code looks good, saw it work |
Looking good! But we really should have tests for this as well (I know I did not write them either...) |
core/register_command.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetic order 🙊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like the rest of the file is? 😆
08390d9
to
d5bff40
Compare
e38039d
to
f6355b3
Compare
Well, doing it properly turned out to be a lot more work than expected, but at least some code smell has been removed. Everything is unit tested too |
f6355b3
to
c6314fc
Compare
A new inspection was created. |
Looks good 👍 |
Looks good and everything seems to work. 👍 |
Introduce mimetype DB update occ command
Awesome! :) |
But I like code smell. It smells like victory. |
This occ command allows mimetypes in the database to be updated from changed mimetypes in config/mimetypemapping.json. By default, it adds any new mimetypes it finds and updates the filecache based on those, but with an option it can scan all existing mimetypes to update mimetypes on files.
For example, you add a new mapping of '.foo' to 'application/foobar', but your existing '.foo' files still have the 'application/octet-stream' mimetype since they were uploaded before. Run
./occ maintenance:mimetype:update-db
to update this. Or, if the 'application/foobar' mimetype already existed,./occ maintenance:mimetype:update-db --repair-filecache
(will be a lot slower for big filecaches!).Please review @rullzer @icewind1991 @MorrisJobke @PVince81 @icewind1991 @DeepDiver1975
cc @carlaschroder for documentation around the new occ command, and rename of the maintenance:mimetypesjs command to maintenance:mimetype:update-js
Fixes #17625