public static function shutdown_function() { $lasterror = error_get_last(); if (in_array($lasterror['type'], array(E_NOTICE, E_STRICT, E_DEPRECATED))) { return true; } $now = date('Y-m-d H:i:s'); $file = str_replace(ROOTPATH, '', $lasterror['file']); var_dump(CNAME, $file); exit; $errortype = self::parse_errortype($lasterror['type']); if (by::redis('backup')->sAdd('errormsg', "{$file}:{$lasterror['line']}")) { //报警 } else { //只累加错误次数 } $error = "{$now} {$errortype}: {$lasterror['message']} in {$lasterror['file']} on line {$lasterror['line']}"; echo $error; }
function in($field, $value) { $object = new by(); return $object->in($field, $value); }