/** * @todo fix me, seems like I'm broken */ protected function fetchRpcLog() { // I realy don't like the way of fetching RPC-Error-Messages... //$hLoglvl = array("error"=>0, "warn"=>1, "notice"=>2, "ok"=>3, "debug"=>4); global $_BBRPC_Msgs; if (is_array($_BBRPC_Msgs)) { foreach ($_BBRPC_Msgs as $key => &$hMsg) { switch ($hMsg["typ"]) { case 0: module\log::error("RPC-Msg.: {$hMsg}", __METHOD__); break; case 1: module\log::warning("RPC-Msg.: {$hMsg}", __METHOD__); break; case 2: module\log::info("RPC-Msg.: {$hMsg}", __METHOD__); break; case 3: module\log::debug("RPC-Msg.: OK! {$hMsg}", __METHOD__); break; case 4: module\log::debug("RPC-Msg.: {$hMsg}", __METHOD__); break; } unset($_BBRPC_Msgs[$key]); } } }
/** * Lets pass all php-errors to our syslog * * @param $errorNumber * @param $errorString * @param $errorFile * @param $errorLine * @return bool */ function errorHandler($errorNumber, $errorString, $errorFile, $errorLine) { showError("Sorry, the script died with a PHP-Error", $errorString . ' in ' . $errorFile . ':' . $errorLine); log::error("PHP-ERROR\n\n!!!!! {$errorString}\n!!!!! {$errorFile}:{$errorLine}\n", __METHOD__, debug_backtrace()); die; }