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
[ticket/10850] Fixing create_schema_files.php so that it creates popper schema files #775
Conversation
We use unix line endings everywhere, why would you use \r\n? It should stay \n. |
Oh ok, nevermind I hadn't read the ticket. Removing t and hardcoding which line endings we want makes a lot of sense. So only question is, do we want it to be \r\n? |
Replace |
Line endings should be |
@naderman @bantu I don't know if they require line endings using \r\n. |
[15:06:59] The php files are all \n |
To me it looks like everything that needs to be done here is replace the |
the problem is worse than I thought. |
That depends on your git configuration. For phpBB you should really configure it to use newlines only. Preferably also on windows. Now the real question that needs to be solved here is, as Andreas said, do we even need any \r\n in those schema files, or can we just leave them as \n everywhere anyway, just like we do for all other files? |
Everything other than mssql should work fine with unix line endings I'm assuming. Mssql should be tested. |
The files are never fed directly to the database, so the line endings aren't going to cause problems. Processing is done on the file first (\r's are removed), then the individual queries are pulled out into an array based on their delimiter, and then they are each executed by the dbal. |
If so we should have linefeeds only in all files. |
Hum... |
I've made some tests here and I found out why I was getting gibberish when I used the "wb" mode in fopen. It had to do with an option I tweaked (I don't remember why) in php. Changing to "wb" solved the problem but maybe not by the reasons most people think. |
We do not rely on git doing that. You should set up your git correctly, so it checks out all line endings as \n. And you should not be using any \r\n, also on windows. |
@naderman |
It is stated in the wiki: http://wiki.phpbb.com/Git#Windows None of us saw a point in forcing this on anyone, hence no gitattributes. But if you don't want \r\n, then configure your git not to give you \r\n. |
"Quick info for those with TortoiseGit (and used to working with TortoiseSVN) " |
Well it's a wiki. Go change it to state that you should always change autocrlf on windows, even if you don't use tortoise. |
This PR should be complete. Please check if everything is working as expected. @naderman done |
The two commits have different ticket numbers. They should be squashed into one commit with the appropriate ticket number selected. The change from text to binary seems sensible given that we expect all files to have unix line endings on windows. This pr should obviously be tested on windows. |
|
Please squash the commits into one. |
Changed the fopen mode from "wt" to "wb" as requested in the PR. The objective behind this is to prevent writting stuff like "\r\r\n" in windows PHPBB3-10850
@p Does that look ok? |
Merged as 7fba5a0 |
Fixed create_schema_files.php by changing the open mode in fopen from "wt" to "wb".
PHPBB3-10850