-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
improveException should suggest installing missing extensions #221
Comments
+multibyte + disabled move_uploaded_file function etc. |
I guess everybody should run checker before start working. So this feature will be obsolete. |
@kravcik no, requirements checker solves different issue and does not help people who use Tracy without other Nette libraries |
IMHO the most confusing is namespace The problem only applies to extension fileinfo in nette/http and nette/mail and some of these extensions in Latte and utils. Some of them are checked in code, some checks can be added. I am 👎 to solve it in Tracy. |
I did not intended this feature for PHP extensions used by Nette but for all commonly missing PHP extensions such as json, curl, mbstring, openssl, ... |
As a general solution it probably makes sense. |
Probably good idea in general, but the message should be more generic (i.e. not mention php.ini) and work not only with extension-related functions (i.e. new/removed core function like set_magic_quotes_runtime()). I believe the message is correct (although confusing), since the lookup is namespace-local first, then global. Same for constants. Maybe it could mention both variants in th message but either is partially correct. |
Why not mention php.ini? Can you post an example of how such message should look like according to you?
That seems out-of scope.
Have you read the bug report? Because that's exatly what is states. |
Call to undefined function Nette\Mail\finfo_buffer or \finfo_buffer, ensure that finfo extension is enabled and loaded. or maybe even like this to avoid namespace confusion:
Yes and it does not. Quoting: The better message should be "Call to undefined function json_encode()". It drops the information about namespace entirely (so if you were using e.g. namespaced function like from GuzzleHttp or libsodium, you would have hard time to figuring that out, because function is not prefixed by extension name - situation depends on actual context / current namespace). |
There is file name and line number. |
But we can know for sure (extension_loaded) whether the extension is loaded. There is no need for the user to check whether the extension is loaded – we know it is not.
You have said „I believe the message is correct (although confusing)“ and @dg has said „the error message (…) is (…) confusing.“ and „both error messages are correct“ |
For message |
@JanTvrdik Will you try to implement it? |
For example Call to undefined function Nette\Mail\finfo_buffer, should be improved to
We obviously can't have a large array with all possible php functions, but having a simple array mapping function prefix to extension name should work well enough for most use-cases.
@dg If you think this would be useful, you may tag this issue as easy pick to encourage contributions.
The text was updated successfully, but these errors were encountered: