예제 #1
0
 static function slowSqlEnd($sql)
 {
     if (!preg_match('/(?:^|\\()SELECT\\s+/is', $sql)) {
         return;
     }
     $sqlExecTime = microtime(1) - self::$slowSqlStartTime;
     if ($sqlExecTime > self::$sqlShowWarn) {
         $of = fopen(ROOT_DIR . '/' . self::$slowSqlFIle, 'ab+');
         $sqlExecTime = $sqlExecTime * 1000;
         fwrite($of, kernel::this_url() . "\t" . $sql . "\t" . $sqlExecTime . "\n");
         fclose($of);
     }
 }