Create a new file errorHandler.php place in the Lampcms dir
Require this file from !inc.php
It will have ErrorHandler function
and ExceptionHandler function
then it will register these functions as default error handler
and default exception handler
Then try to do away with the try/catch block in index.php and have the default exception handler catch all uncaught exceptions
and email admin on errors.
Inside ExceptionHandler always try to use Mailer class first inside try/catch the inside the catch block
fallback to mail() function.
This way we can still attempt to use SwiftMailer for error emails but it that does not work then fallback to php's mail()
Create a new file errorHandler.php place in the Lampcms dir Require this file from !inc.php It will have ErrorHandler function and ExceptionHandler function then it will register these functions as default error handler and default exception handler
Then try to do away with the try/catch block in index.php and have the default exception handler catch all uncaught exceptions and email admin on errors.
Inside ExceptionHandler always try to use Mailer class first inside try/catch the inside the catch block fallback to mail() function.
This way we can still attempt to use SwiftMailer for error emails but it that does not work then fallback to php's mail()