Welcome Guest, Not a member yet? Register   Sign In
Anybody in favour of using PHP error reporting instead of Kint?
#1

(This post was last modified: 06-25-2021, 10:22 PM by John_Betong.)

I find Kint supplies a vast amount of inconsequential data and that PHP default error reporting is far better. 
Reason is that PHP stops on the first error, gives the file name and line number which is perfectly adequate.
I have modified the following file and prefer this method of Debugging:
File:  ./system/Debug/Exceptions.php
PHP Code:
# REACTIVATE PHP DEFAULT ERROR REPORTING 
        /**
        * Responsible for registering the error, 
          exception and shutdown handling 
          of our application.
        */
        public function initialize()
        {
          # Set the Exception Handler
            # John - 2021-06-26 - proposal
            if(CI_DEBUG) :
              set_exception_handler([$this'exceptionHandler']);

              # Set the Error Handler
                set_error_handler([$this'errorHandler']);

              # Set the handler for shutdown to catch Parse errors
              # Do we need this in PHP7?
                register_shutdown_function([$this'shutdownHandler']);
            endif;
        
Reply


Messages In This Thread
Anybody in favour of using PHP error reporting instead of Kint? - by John_Betong - 06-25-2021, 10:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB