-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
Clean up usages / deprecate path helpers #2155
Conversation
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.
I've added some comments. Especially the change to use the system tmp directory isn't really a good idea as the previous implementation tempnam
would try the given directory and fallback on the system directory. This implementation now has no failsafe at all if the system tmp directory isn't writable.
Less I/O, and one less place where we access the global path helpers.
This was probably taken straight from Laravel. There is no equivalent concept in Flarum, so this should be safe to remove.
Developers using these helpers can inject the `Paths` class instead.
a) The comparison was already outdated, as a different path was passed. b) We're trying to get rid of these global helpers.
691ac14
to
fd32230
Compare
Looks good to merge IMO |
Relates to #2055
Changes proposed in this pull request:
public_path()
Application
class, e.g.Application::publicPath()
All of these are left-overs from our deeper Laravel integration. The recommended way to access these is to use the
Paths
class, which is injectable as a proper dependency.All remaining changes are cleanups of places where we used the helpers ourselves - some of them quite obscure (e.g. in
WritablePaths
).Reviewers should focus on:
Any downsides to removing these? I haven't yet found a case, where refactoring away from the global helpers did not result in an improvement.
Confirmed
Frontend changes: tested on a local Flarum installation.composer test
).Required changes: