symfony - How to automatically handle all unhandled php errors in symfony2? -
disclaimer:
seems guys need real world example that. here is:
file_get_contents($filename);
keep in mind thread safety , race conditions.
or other php notice/warning or kind of recoverable exception.
where either not defined. , run in default app.php
default symfony v2.3.5 configs - see
notice: undefined variable: in /var/www/.../uibundle/controller/deploycontroller.php on line 57 call stack: 0.0000 629696 1. {main}() /var/www/.../web/app.php:0
which not expect since in production mode framework should handle everything, log , show nice 404/500 user.
what missing , config parameter should change behaviour expect?
upd:
this question how handle unhandled php errors user didn't see stacktrace proper error page on production. treat $i++
, \bla()
unexpected case, bug.
upd 2:
yes, i'm aware of debug
parameter of kernel
class, , don't see switching to
$kernel = new appkernel('prod', true); ^--- changed false
reasonable, since need real production environment.
upd 3:
guys, i'm aware unit, functional, acceptance , integration tests for. question is not testing. question is: how handle php errors symfony2 natively.
upd 4:
the question latest symfony2 branch - 2.3 (or v2.3.5 specifically)
upd 5:
--- doesn't log notices/warnings :-sdebug::enable(null, false);
- please comment possible negative side effects if used in production?
Comments
Post a Comment