-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Issue in framework/src/Illuminate/Foundation/helpers.php #8913
Comments
No it doesn't. PHP converts it internally before doing the low level operations. |
Really? because public_path() on widows returns so why the / if it's already corrected? i'll edit the issue in any case |
This is an issue, but it is a BC breaking change. So should be done at the next major release whenever that happens. |
The issue is with consistency and parsing of paths. public_path uses / while path.public uses DIRECTORY_SEPARATOR: https://github.com/laravel/framework/blob/5.0/src/Illuminate/Foundation/Application.php#L338
Not a huge deal but something to be considered. Possible BC break for windows users who have parsed paths. |
Yes, that's fine. Under the hood, php will make the correct low level calls when you actually use the filesystem. |
@GrahamCampbell Feels like you're dodging the actual issue here. Paths can be saved to db/returned by API and be used in other languages too. And as I stated earlier, inconsistency when parsing strings is still an issue, just |
That doesn't seem to be an issue as far as I'm concerned. You need a more robust solution if you want to do that. You may want to write yourself a simple normalize path function or something. |
Yeah, you're right, you should write a normalize function for exploding separators using public_path(). It actually should be inconsistent for no apparent reason. |
This is the framework producing inconsistent output. Something Taylor prides himself on it doing. Consistency and reliability are major things Laravel offers developers, and this fails in that regard. It is a major issue, and in fact breaks the ability to simply hand off the paths generated to another method since you then would need to wrap it in your own function to normalize it yourself. Either way though, it is an existing issue that could be relied upon in user-land code. Fixing it could introduce a BC break. So it should not be addressed in the 5.x line but taken care of in 6.0 whenever that happens to land. |
public_path() , database_path() , config_path() , app_path()
fail to work correcly on widows
public_path() returns example : c:\www\project\public as c:\www\project\public/
as you can see here
https://github.com/laravel/framework/compare/5.0...Ermac25:Ermac25-patch-1?expand=1
using DIRECTORY_SEPARATOR solves the issue
The text was updated successfully, but these errors were encountered: