예제 #1
0
 /**
  * @param Notifier $notifier
  */
 public function registerShutdownHandler(Notifier $notifier)
 {
     $self = $this;
     if (!self::$registerShutdownFlag) {
         register_shutdown_function(function () use($notifier, $self) {
             if (false != ($lastError = $self->catchLastError())) {
                 $notifier->reportPhpError($lastError['type'], $lastError['message'], $lastError['file'], $lastError['line']);
             }
             $notifier->flush();
         });
         self::$registerShutdownFlag = true;
     }
 }