/** * function __errorProcess($errorException): * Handle the error of the exception generated by Matcha:connect * it now support FirePHP and ChomePHP. */ public static function __errorProcess($errorException, $__browserDebug = true) { // construct the exception error $trace = $errorException->getTrace(); $constructErrorMessage = 'Exception: "'; $constructErrorMessage .= $errorException->getMessage(); $constructErrorMessage .= '" @ '; if ($trace[0]['class'] != '') { $constructErrorMessage .= $trace[0]['class']; $constructErrorMessage .= '->'; } $constructErrorMessage .= $trace[0]['function']; $constructErrorMessage .= '();'; // normal output - to Apache error.log error_log('Matcha::connect: ' . $constructErrorMessage); // Browser Debug Feature - Plugin $browserName = MatchaUtils::BrowserOS()->getBrowser(); if ($__browserDebug) { if ($browserName == Browser::BROWSER_FIREFOX) { MatchaUtils::FirePHP()->getInstance(true)->log($constructErrorMessage, 'FirePHP -> '); } // if($browserName == Browser::BROWSER_CHROME) MatchaUtils::ChromePHP()->log('ChromePHP -> '.$constructErrorMessage); } return $errorException; }