Skip to content
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

Commits for review: Add php Error Reporting Functionality to PMA #1207

Closed
wants to merge 21 commits into from

Conversation

JayNakrani
Copy link
Contributor

Add php Error Reporting Functionality to PMA.

…s script is intended to be used same as common.inc.php, but at the end of each script.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
… error local & temporary log file.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
…file usage.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
…turn first 'X' frames. Send stackhash too.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
…erver URL.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
…r 'false' (user warnings) errors).

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
@JayNakrani
Copy link
Contributor Author

I'm working on the suggestions of @phpmyadmin-bot. Will push those changes fixing the issues soon.

@nijel
Copy link
Contributor

nijel commented Jun 6, 2014

As I've mentioned before requiring common_error_reporting.inc.php in every file is really bad idea. You should instead hook into Footer class, which is already executed at the end of rendering of every page.

@nijel
Copy link
Contributor

nijel commented Jun 6, 2014

...I'd probably hook into PMA_Footer::getErrorMessages method.


$_REQUEST['exception_type'] = 'php';
$_REQUEST['send_error_report'] = '1';
require_once('error_report.php');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should do the error submission asynchronously from the client so that it does not block loading of the page.

@nijel
Copy link
Contributor

nijel commented Jun 6, 2014

And last but not least, please rebase your changes on current master to make ti possible to merge your changes.

@JayNakrani
Copy link
Contributor Author

Okay. I will remove the common_error_reporting.php and move that code into a function of PMA_Error_Handler class. That function will be called from PMA_Footer::getErrorMessages().

But should I create a separate branch for that development or is it okay to continue pushing commits on top of this branch?

@JayNakrani
Copy link
Contributor Author

@nijel : I just realized there'd be a problem in putting the common_error_reporting.php code into PMA_Footer::getErrorMessages(). In each request (ajax as well as non-ajax) to PMA there'd be some more code that'll be executed after the call of PMA_Footer::getErrorMessages() and error occurring in that part can not be reported. That problem would not be there if error reporting code is executed at the end of the all script execution. Is PMA_Footer::getErrorMessages() the last thing in each execution? Can you confirm this, please?

@nijel
Copy link
Contributor

nijel commented Jun 6, 2014

It's not the last thing being executed, but I don't see a problem with this as the error would be stored in the session and reported with next request.

@nijel
Copy link
Contributor

nijel commented Jun 6, 2014

...and you can continue to push commits to this branch.

@JayNakrani
Copy link
Contributor Author

Okay, thanks. I will push the suggested changes shortly.

…reportError()'. Hook it in 'PMA_Footer::getErrorMessages()'.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
… from all the scripts.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
…') aysnchronous. Stop infinite auto error reporting loop.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
@JayNakrani
Copy link
Contributor Author

@nijel : I've pushed the suggested changes.

  • Moved the error reporting code from common_error_reporting.php to PMA_Error_Handler::reportError().
  • Removed common_error_reporting.php file & corresponding inclusions.
  • Hooked the call to error reporting function in PMA_Footer::getErrorMessages().
  • Made error reporting asynchronous in the case of sendErrorReport = 'always'.

Please review above commits.

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
@nijel
Copy link
Contributor

nijel commented Jun 9, 2014

Still the code is not mergeable, so please rebase it on upstream repository. I'll go through the code right now...

. '" onclick="PMA_ignorePhpErrors()" style="float: right; margin: 20px;">'
. '<input type="submit" value="'
. __('Ignore All')
. '" onclick="PMA_ignorePhpErrors(false)" style="float: right; margin: 20px;">'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid using inline javascript, rather bind it to the class or element id in the javascript code.

@JayNakrani
Copy link
Contributor Author

I've created rebasing in a separate branch. See, Pull#1219.

Closing this one for now.

@JayNakrani JayNakrani closed this Jun 10, 2014
@nijel
Copy link
Contributor

nijel commented Jun 11, 2014

For the next time: You don't have to close the pull request and open new one, it's enough to force pushing branch over existing one.

@JayNakrani JayNakrani deleted the dhananjay-gsoc-dev branch June 16, 2014 17:05
madhuracj added a commit that referenced this pull request Feb 24, 2015
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants