-
-
Notifications
You must be signed in to change notification settings - Fork 186
Media firewall 2: Differentiate between mediaRoot/mediaDir
#7196
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
8ca8ef4 to
0791516
Compare
distantnative
left a comment
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.
To me the breaking change is worth it as the naming scheme would make a lot of sense this way.
Would be good if @bastianallgeier also has a look at this.
New solution discussed on Discord
0791516 to
5221bfc
Compare
Changes
@lukasbestle please check if you are happy with those changes. |
|
Thank you for adapting it, looks good to me. Unfortunately I cannot approve my own PR :) One thing I thought about is whether we want to deprecate |
mediaRoot/mediaPathmediaRoot/mediaDir
|
Another thought on the deprecation: We could actually introduce the media subclasses in v5.x and deprecate all old methods in one go then. This avoids having to migrate calls to the new methods twice. Which means we can merge this as is. If we want, we could already add |
|
@lukasbestle sounds good to me! |
Description
Summary of changes
$filenameparam for$file->mediaRoot()and$file->mediaUrl()$file->mediaDir()method (= directory where media of that file model is stored)mediaRoot()tomediaDir()for other model classesReasoning
mediaRoot()andmediaUrl()allows to clean up thumb-related code and is also needed for the media firewall PR 3 Media firewall 3: Introduce media subhashes #7195.Changelog
Enhancements
$file->mediaDir()method that returns the directories where media of that file model is stored. Matching method aliases for thePage,SiteandUserclasses are provided.$file->mediaRoot()and$file->mediaUrl()methods now accept a new optional$filenameargument so they can be used to construct roots and URLs to thumbs.Breaking changes
None
Docs
None
Ready?
For review team