-
Notifications
You must be signed in to change notification settings - Fork 291
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
Survive through a malformed installed.json file. #391
Survive through a malformed installed.json file. #391
Conversation
Hi @bucefal91 - nice catch! The phar will need to be rebuilt, and I'd like an additional test case for this edge case too. Do you want to try your hand at it or shall I? |
Hello, @jnvsor , Thank you for your prompt reply. I sure can try :) I hope to have it done by the end of today. |
You should just be able to add a |
…e to this edge case.
@jnvsor , I think I have applied your proposals/feedback:
|
Hi @bucefal91 sorry for the delay I didn't get a notification from gh Looks good and I presume the tests will pass too (Looks like the build didn't match, did you format after build or before?) Could you use |
@jnvsor , Yes, sir! :) I've changed it to the strict equality in the test and rebuilt the .phar file anew. |
Passed, merged, tagged, pushed. Good job! |
Thank you, I appreciate your support and desire to take a patch into the project. :) |
We have been using Kint and occasionally would run into the following concern.
Somehow, during the deployments (when the system is transitioning from "old" to the "new" state), we would encounter PHP warnings
I am unable to reproduce it "per se". But any simple change to the
vendor/composer/installed.json
will reproduce it, i.e. just edit this file and make it a "malformed" JSON. The point is that\json_decode(\file_get_contents($installed), true);
would fail to parse it. Technically,composer
could fail or people could manually tamper the file so I think "dealing" with the edge case where the file does not contain valid JSON is a worthwhile thing to have :)With this patch/PR applied, even if you "mess up" your
vendor/composer/installed.json
, the warning will not be generated.