Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class FrontController extends FrontControllerCore
- {
- public function __construct()
- {
- # define a custom error handler so we can log PHP errors
- set_error_handler('_exception_handler');
- }
- }
- /**
- * This is the custom exception handler that is declaired at the top
- * of Prestashop. The main reason we use this is to permit
- * PHP errors to be logged in Prestashop Logger system since the user may
- * not have access to server logs. Since this function
- * effectively intercepts PHP errors, however, we also need
- * to display errors based on the current error_reporting level.
- * We do that with the use of a PHP error template.
- *
- * @access private
- * @return void
- *
- * @param $severity
- * @param $message
- * @param $filepath
- * @param $line
- */
- function _exception_handler($severity, $message, $filepath, $line)
- {
- // We don't bother with "strict" notices since they tend to fill up
- // the log file with excess information that isn't normally very helpful.
- // For example, if you are running PHP 5 and you use version 4 style
- // class functions (without prefixes like "public", "private", etc.)
- // you'll get notices telling you that these have been deprecated.
- if ($severity == E_STRICT)
- {
- return;
- }
- $message = $message . ' - line ' . $line . ' in '.$filepath;
- Logger::addLog($message, $severity, NULL, NULL, NULL, TRUE);
- }
Add Comment
Please, Sign In to add comment