<div dir="ltr"><div>Hi Everyone,</div><div>This week I started developments on my project. I want to take community's opinion on work I've done so far. Look at the commits [0] & [1].</div><div><br></div><div>Currently `<font face="courier new, monospace">common.inc.php</font>` does all error handling initializations. All the run time php errors are already being collected in an object of `<font face="courier new, monospace">PMA_Error_Handler</font>` pointed globally by `<font face="courier new, monospace">$GLOBALS['error_handler']</font>`. </div>
<div><br></div><div>Now, to report all errors I have created a separate script named <font face="courier new, monospace">'common_error_reporting.inc.php'</font> which is intended to be included at the end of all "<b><i>relevant</i></b>" scripts. Currently it dumps all collected errors in a local-temporary file named "<font face="courier new, monospace">pma_error_log.txt</font>" (which will be removed in next week's work). To demonstrate the working of `<font face="courier new, monospace">common_error_reporting.inc.php</font>`, I've included that script at the end of `<font face="courier new, monospace">index.php</font>`. 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 improve it any further. If there are no changes required in it then I would do the same for all "<i><b>relevant</b></i>" scripts.</div><div><br>
</div><div><br></div><div>Another doubt I have is about the relevance of scripts. Which scripts should be consider as relevant here?? I am thinking of considering all scripts that are directly called by user/browser. I think error reporting script does not need to be included at the end of class files and such other library files. In my opinion, the error reporting script should be included at the end of all scripts in project root directory and not in any files inside `/libraries/` directory. Am I correct on this?</div>
<div><br></div><div><br></div><div>I also found that PMA triggers errors manually (using <font face="courier new, monospace">trigger_error()</font>) for all the missing extensions and to raise other such user warnings. These warnings are also currently collected by error handler. Do we need to report them?? Or should the errors of <font face="courier new, monospace">E_USER_WARNING</font> type just be ignored while sending reports?</div>
<div><br></div><div><br></div><div>Please provide your valuable suggestions and do correct me if I am wrong anywhere. If possible do it at the earliest so that I can incorporate them at an early stage.</div><div><br></div>
<div><br></div><div>[0]: <a href="https://github.com/dhananjay92/phpmyadmin/commit/7bdad8efe33bed52d25e13ca1c064736c66fd022">https://github.com/dhananjay92/phpmyadmin/commit/7bdad8efe33bed52d25e13ca1c064736c66fd022</a></div>
<div>[1]: <a href="https://github.com/dhananjay92/phpmyadmin/commit/b137255bb617f7f00ac4b734d8b003a6ecd47128">https://github.com/dhananjay92/phpmyadmin/commit/b137255bb617f7f00ac4b734d8b003a6ecd47128</a></div><div><br></div>
<div><br></div><div>Thanks,</div><div>Dhananjay Nakrani.</div></div>