Пример #1
0
 /**
  * Called when PHP exits.
  */
 public static function shutdown()
 {
     $error = error_get_last();
     if ($error) {
         //Log only fatal errors because other errors should have been logged by the normal error handler
         if ($error['type'] == E_ERROR || $error['type'] == E_CORE_ERROR || $error['type'] == E_COMPILE_ERROR || $error['type'] == E_RECOVERABLE_ERROR) {
             self::errorHandler($error['type'], $error['message'], $error['file'], $error['line']);
         }
     }
     //clear temp files on the command line because we may run as root
     if (PHP_SAPI == 'cli') {
         \GO::session()->clearUserTempFiles(false);
     }
     \GO::debugPageLoadTime('shutdown');
     \GO::debug("--------------------\n");
 }