<div dir="ltr">Hi Michal,<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 15, 2014 at 4:13 PM, Michal Čihař <span dir="ltr"><<a href="mailto:michal@cihar.com" target="_blank">michal@cihar.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Dhananjay<br>
<br>
Dne Sat, 10 May 2014 22:30:41 +0530<br>
Dhananjay Nakrani <<a href="mailto:dhananjaynakrani@gmail.com">dhananjaynakrani@gmail.com</a>> napsal(a):<br>
<div class=""><br>
> This week I started developments on my project. I want to take community's<br>
> opinion on work I've done so far. Look at the commits [0] & [1].<br>
<br>
</div>I've already commented on the commits, but giving more detailed answer<br>
here now.<br>
<div class=""><br>
> Currently `common.inc.php` does all error handling initializations. All the<br>
> run time php errors are already being collected in an object of `<br>
> PMA_Error_Handler` pointed globally by `$GLOBALS['error_handler']`.<br>
<br>
</div>Indeed, this is true.<br>
<div class=""><br>
> Now, to report all errors I have created a separate script named<br>
> 'common_error_reporting.inc.php' which is intended to be included at the<br>
</div>> end of all "*relevant*" scripts. Currently it dumps all collected errors in<br>
<div class="">> a local-temporary file named "pma_error_log.txt" (which will be removed in<br>
> next week's work). To demonstrate the working of `<br>
> common_error_reporting.inc.php`, I've included that script at the end of `<br>
> index.php`. Please have a look at it at [0] & [1].<br>
> Is there any better way of doing the same? Please point out if I can<br>
> improve it any further. If there are no changes required in it then I would<br>
</div>> do the same for all "*relevant*" scripts.<br>
<div class="">><br>
><br>
> Another doubt I have is about the relevance of scripts. Which scripts<br>
> should be consider as relevant here?? I am thinking of considering all<br>
> scripts that are directly called by user/browser. I think error reporting<br>
> script does not need to be included at the end of class files and such<br>
> other library files. In my opinion, the error reporting script should be<br>
> included at the end of all scripts in project root directory and not in any<br>
> files inside `/libraries/` directory. Am I correct on this?<br>
<br>
</div>I'd just keep the current framework used for displaying the errors (when<br>
$cfg['Error_Handler']['display'] is set to true) and extend it to emit<br>
information for the error reporter in case there is new error (maybe as<br>
JSON data). So I think best place to handle this is to hook into<br>
PMA_Footer::getErrorMessages and pass there the data to the browser.<br>
The client side then can do the reporting itself (same as it is with<br>
the Javascript errors right now).<br></blockquote><div><br></div><div>Yes, indeed that would be an easier way. I looked for the code relating to it. I found that <font face="'courier new', monospace">PMA_Footer::getErrorMessages()</font> writes a <font face="'courier new', monospace">div</font> element with as <font face="'courier new', monospace">'pma_errors'</font> its id. I found that <font face="'courier new', monospace">div</font> to be present in response of <font face="'courier new', monospace">index.php. </font><font face="arial, helvetica, sans-serif">But I could not find that </font><font face="'courier new', monospace">div</font><font face="arial, helvetica, sans-serif"> in the responses generated by other scripts which are executed when user clicks on any of the tabs (Database, SQL, Import, Export etc.). I also looked inside the </font><font face="'courier new', monospace">data._errors </font><font face="arial, helvetica, sans-serif">in the </font><span style="font-family:'courier new',monospace">AJAX.</span><span style="font-family:'courier new',monospace">responseHandler() </span><font face="arial, helvetica, sans-serif">[0]</font><span style="font-family:'courier new',monospace">. </span><font face="arial, helvetica, sans-serif">Is there anywhere else I should be looking instead??</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><br>
> I also found that PMA triggers errors manually (using trigger_error()) for<br>
> all the missing extensions and to raise other such user warnings. These<br>
> warnings are also currently collected by error handler. Do we need to<br>
> report them?? Or should the errors of E_USER_WARNING type just be ignored<br>
> while sending reports?<br>
<br>
</div>I think we care only about errors raised by PHP, all these<br>
E_USER_WARNING are usually just wrong configuration issues. </blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
--<br>
Michal Čihař | <a href="http://cihar.com" target="_blank">http://cihar.com</a> | <a href="http://phpmyadmin.net" target="_blank">http://phpmyadmin.net</a><br>
</font></span><br>------------------------------------------------------------------------------<br>
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE<br>
Instantly run your Selenium tests across 300+ browser/OS combos.<br>
Get unparalleled scalability from the best Selenium testing platform available<br>
Simple to use. Nothing to install. Get started now for free."<br>
<a href="http://p.sf.net/sfu/SauceLabs" target="_blank">http://p.sf.net/sfu/SauceLabs</a><br>_______________________________________________<br>
Phpmyadmin-devel mailing list<br>
<a href="mailto:Phpmyadmin-devel@lists.sourceforge.net">Phpmyadmin-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
<br></blockquote></div><br></div><div class="gmail_extra">[0] : <a href="https://github.com/phpmyadmin/phpmyadmin/blob/master/js/ajax.js#L285">https://github.com/phpmyadmin/phpmyadmin/blob/master/js/ajax.js#L285</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Dhananjay Nakrani.</div></div>