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?
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.
精彩评论