Opened 12 years ago
Closed 12 years ago
#142 closed defect (fixed)
error_reporting inconsistentcy
Reported by: | osjonathan | Owned by: | theduckylittle |
---|---|---|---|
Priority: | minor | Milestone: | 2.6.1 |
Component: | GeoMOOSE/PHP | Version: | 2.6 |
Keywords: | Cc: |
Description
Quite a few scripts have:
error_reporting(E_ERROR | E_PARSE);
in them. There are a few issues here:
Some scripts have it inside a
if(!$DEBUG) { error_reporting(E_ERROR | E_PARSE); }
While others miss the if statement entirely.
Further, in query.php, there's this:
if(!$DEBUG) { } error_reporting(E_ERROR | E_PARSE);
Also, doesn't this defeat the point of setting this in php.ini? If PHP-level error reporting is needed for debugging it should be set in php.ini (which I set to E_ALL myself). The application then over-riding that with a lesser level of reporting just makes life a little difficult.
I'd therefore suggest that error_reporting(); shouldn't be used at all in the scripts, but if it must be, (a) it should probably be done consistently, (b) it should never lower the level of reporting (i.e., going from E_ALL to E_ERROR) only raise it.
Change History (4)
comment:1 by , 12 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 12 years ago
Status: | assigned → testing |
---|
comment:3 by , 12 years ago
Milestone: | → 2.6.1 |
---|---|
Version: | → 2.6 |
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | testing → closed |
We specifically use error repression in the application because the PHP bindings for MapServer can throw warnings that do not effect the result but break the application as a whole. (As the application is expecting XML as the return type.)
I've made the behavior consistent in all scripts, r883