/** * @param Airbrake\Notice $notice * @return string **/ public function send(\Airbrake\Notice $notice) { $curl = curl_init(); $xml = $notice->toXml($this->configuration); curl_setopt($curl, CURLOPT_URL, $this->configuration->apiEndPoint); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_TIMEOUT, $this->configuration->timeout); curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $return = curl_exec($curl); curl_close($curl); return $return; }
/** * Notify on an exception * * @param Airbrake\Notice $notice * @return string */ public function notifyOnException(Exception $exception) { $notice = new Notice(); $notice->load(array('errorClass' => get_class($exception), 'backtrace' => $this->cleanBacktrace($exception->getTrace() ?: debug_backtrace()), 'errorMessage' => $exception->getMessage() . ' in ' . $exception->getFile() . ' on line ' . $exception->getLine())); return $this->notify($notice); }
/** * Notify on an exception * * @param Exception $e * @param null $extraParams * @return bool */ public function notifyOnException(Exception $e, $extraParams = null) { $notice = new Notice(); $notice->load(array('errorClass' => get_class($e), 'backtrace' => $this->cleanBacktrace($e->getTrace() ?: debug_backtrace()), 'errorMessage' => $e->getMessage() . ' in ' . $this->cleanFilePath($e->getFile()) . ' on line ' . $e->getLine(), 'extraParameters' => $extraParams)); return $this->notify($notice); }
/** * Notify on an exception * * @param Exception $exception * * @return string */ public function notifyOnException(Exception $exception) { $notice = new Notice(); $notice->setConfiguration($this->configuration)->load(['errorClass' => get_class($exception), 'backtrace' => debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), 'errorMessage' => $exception->getMessage() . ' in ' . $exception->getFile() . ' on line ' . $exception->getLine()]); return $this->notify($notice); }