Jump to content

Debugging: xDebug breaks at at sign "@"


Recommended Posts

Hi!

I just started debugging with xDebug and Atom and I have stumbled upon a disturbing issue.

 

xDebug always breaks in Media.php here:

 

  if (!@filemtime($file_uri) || @filesize($file_uri) === 0) {
                if (!defined('_PS_HOST_MODE_')) {
                    return false;
                } elseif (!@filemtime($file_uri_host_mode) || @filesize($file_uri_host_mode) === 0) {
                    return false;
                } else {
                    $media_uri = $media_uri_host_mode;
                }
            }
 
Why is someone hiding the errors with "@" http://www.php.net/manual/en/language.operators.errorcontrol.php
 
Do you know how to make xDebug pass by these errors?
 
The whole debugging process becomes pain in the a**!
Link to comment
Share on other sites

What I did is to check if the $file_uri exists with an if else statement and removed the error control operators.

 

if (file_exists($file_uri)) {

 
            if (!filemtime($file_uri) || filesize($file_uri) === 0) {
            ....
}
 
Do you think this is a long therm solution?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...