-
Notifications
You must be signed in to change notification settings - Fork 147
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
Fix require path for windows #141
Conversation
In windows the generated path has the last separator wrong, using default PHP constant DIRECTORY_SEPARATOR allows your code to work correctly in both windows and *nix
Just so it's noted - the forward slash does work perfectly well on Windows in PHP and there's nothing wrong with using it. I'm only aware of a single issue with it and it's in libxml. But that being said, |
You are right, it should work but I don't know if this is due to a particular setup but we have lot of errors like this in out log: [05-Jun-2018 19:39:55 Europe/Rome] PHP Fatal error: require_once(): Failed opening required 'D:\Siti\project_name\vendor\paragonie\random_compat\lib/byte_safe_strings.php' (include_path='.;C:\php\pear') in D:\Siti\ricordavet.it\vendor\paragonie\random_compat\lib\random.php on line 52 Now that we changed to DIRECTORY_SEPARATOR in our local version those errors are gone |
That is pretty weird as I've tested on Windows Server 2008, 2012 and 2016 and couldn't replicate this issue. But it's also mentioned in #136. Anyway, this looks fine to me. 👍 |
There's no downside to this change, but as others have stated, I cannot reproduce this issue either. |
I'd bet the error state was cached ... That is, an include was attempted while the path didn't exist, PHP cached that it doesn't exist and then short-circuits on successive attempts, erroring while the path is now correct. Changing the slash alters the path and therefore it no longer hits the cache, so that's why it looks like it's of any importance. |
Oh hey that's new! Github didn't used to show comments on commits in this view before? |
what is the "this view"? link? screenshot? :) |
i mean what's your url. i see your comment in PR view: #141 (comment)
|
The "that's new!" was about it also showing up in PR view, rather than merely on the commit. |
Anyway, this is all off-topic.
|
In windows the generated path has the last separator wrong, using default PHP constant DIRECTORY_SEPARATOR allows your code to work correctly in both windows and *nix