code igniter extend show_error

2019-07-22 20:30发布

问题:

I implemented a rollback mechanism for my php execution so if an error occurs it will pop a stack and undo actions. How can I add this hook so my function is called anytime show_error is used?

回答1:

Actually there is no such hook available.You need to hack it.
Modify the function "show_error()" in CI_Exceptions class (File: system/libraries/Exceptions.php) as per your Requirement.

This should be a reference to start with.

Update:
You should extent CI_Exceptions rather then modifying in-place.



标签: codeigniter