/** * test case */ public function testErrorHandler() { $this->errorHandler->setEnabledLog(true); $this->errorHandler->setOrigErrorHandler(array($this, "myOrigErrorHandler")); $this->errorHandler->errorHandler(1, "test", "test", 1, array("test")); $this->assertArrayCount(1, $this->errorHandler->getErrorLog()); }
/** * Iterate all logged errors of the given error handler and write them * into the internal log object. * * @param Enlight_Extensions_ErrorHandler_Bootstrap $errorHandler */ public function logError($errorHandler) { $errors = $errorHandler->getErrorLog(); if (empty($errors)) { return; } $counts = array(); foreach ($errors as $errorKey => $error) { $counts[$errorKey] = $error['count']; } array_multisort($counts, SORT_NUMERIC, SORT_DESC, $errors); $rows = array(); foreach ($errors as $error) { if (!$rows) { $rows[] = array_keys($error); } $rows[] = array_values($error); } $table = array('Error Log (' . count($errors) . ')', $rows); $this->Log()->table($table); }