Пример #1
0
 static function shutdown()
 {
     // check execution time
     self::$time_end = number_format(sys_get_microtime() - self::$time_start, 2);
     if (self::$time_end > SYSTEM_SLOW) {
         sys_log_message_log("system-slow", sprintf("{t}%s secs{/t}", self::$time_end) . " " . basename(_sys_request_uri()), _sys_request_uri());
     }
     // process error.txt
     $size = @filesize(SIMPLE_CACHE . "/debug/error.txt");
     if ($size > 0 and $size <= 2097152 and $msgs = @file_get_contents(SIMPLE_CACHE . "/debug/error.txt")) {
         // 2M
         @unlink(SIMPLE_CACHE . "/debug/error.txt");
         $msgs = array_reverse(explode("\n", $msgs));
         foreach ($msgs as $msg) {
             if ($msg == "") {
                 continue;
             }
             $vars = unserialize($msg);
             sys_log_message($vars[0], $vars[1], $vars[2], $vars[3], true, $vars[4]);
         }
     } else {
         if ($size > 0) {
             sys_die("{t}The error logfile cannot be processed, too large:{/t} " . SIMPLE_CACHE . "/debug/error.txt");
         }
     }
     // logging
     sys_log_stat("pages", 1);
 }