コード例 #1
0
 /**
  *
  * @param Exception $e
  *
  * @return array
  */
 public function formatException(Exception $e)
 {
     return array('class' => $e instanceof ErrorException ? fpErrorNotifierErrorCode::getName($e->getSeverity()) : get_class($e), 'code' => $e->getCode(), 'severity' => $e instanceof ErrorException ? $e->getSeverity() : 'null', 'message' => $e->getMessage(), 'file' => "File: {$e->getFile()}, Line: {$e->getLine()}", 'trace' => $e->getTraceAsString());
 }
コード例 #2
0
 public function testGetName()
 {
     $this->assertEquals('E_CORE_ERROR', fpErrorNotifierErrorCode::getName(fpErrorNotifierErrorCode::E_CORE_ERROR));
     $this->assertEquals('E_UNKNOWN', fpErrorNotifierErrorCode::getName('FOO'));
 }
コード例 #3
0
  /**
   * 
   * @return void
   */
  public function handleFatalError()
  {
    $error = error_get_last();

    $skipHandling = 
      !$error || 
      !isset($error['type']) || 
      !in_array($error['type'], fpErrorNotifierErrorCode::getFatals());
    if ($skipHandling) return;

    $this->freeMemory();
    
    @$this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
    
//    $sfE = new sfException();
//    $sfE->setWrappedException($error);
//    $sfE->printStackTrace();
  }
コード例 #4
0
 /**
  * 
  * @return void
  */
 public function handleFatalError()
 {
     $error = error_get_last();
     $skipHandling = !$error || !isset($error['type']) || !in_array($error['type'], fpErrorNotifierErrorCode::getFatals());
     if ($skipHandling) {
         return;
     }
     $this->freeMemory();
     @$this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
 }
コード例 #5
0
 /**
  *
  * @return bool
  */
 public function handleFatalError()
 {
     $this->freeMemory();
     $error = error_get_last();
     $error = array_merge(array('type' => null, 'message' => null, 'file' => null, 'line' => null), (array) $error);
     if (!in_array($error['type'], fpErrorNotifierErrorCode::getFatals())) {
         return false;
     }
     $this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
     return true;
 }