本文整理汇总了PHP中LogUtil::getFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP LogUtil::getFileName方法的具体用法?PHP LogUtil::getFileName怎么用?PHP LogUtil::getFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogUtil
的用法示例。
在下文中一共展示了LogUtil::getFileName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toHTML
function toHTML($e)
{
$code = $e["code"];
$c = "";
$h = "";
if (is_string($code)) {
$c = $code;
} else {
foreach (array("Dolittle", "JavaScript", "C") as $lang) {
if (isset($code[$lang])) {
$c .= $code[$lang];
}
}
if (isset($code["HTML"])) {
$h = $code["HTML"];
}
}
$time = preg_replace("/\\//", "-", $e["date"]) . "T" . $e["time"];
$n = LogUtil::getFileName($e);
if (isset($e["score"])) {
$s = $e["score"];
$diy = $s["d"] ? "D" : "";
$diy .= $s["i"] ? "I" : "";
$diy .= $s["y"] ? "Y" : "";
$com = $s["com"];
$score = "<font color=blue>{$diy} {$com}</font><BR>";
} else {
$score = "";
}
return "<pre>" . mkTimeLink($time) . "<BR>" . "<font color=red>" . $e["detail"] . "</font><BR>" . "<font color=green>" . $e["filename"] . "</font><BR>" . $score . preg_replace("/ /", " ", htmlspecialchars($c)) . "<br>HTML:<BR>" . preg_replace("/ /", " ", htmlspecialchars($h)) . "<BR>" . "\n</pre><BR>";
}
示例2: readJSONLog
function readJSONLog($file)
{
global $fs, $min, $max;
$tlines = explode("\n", $fs->getContent($file));
$j = new Services_JSON();
echo "<script>queue.push(function () {\n";
echo "setUser('{$file}');\n";
$es = array();
foreach ($tlines as $tline) {
$e = $j->decode($tline);
if ($e) {
$e["status"] = "NonError";
if (isset($e["result"]) && strpos($e["result"], "Error")) {
$e["isError"] = true;
$e["status"] = "Error";
} else {
$e["isError"] = false;
}
if (isset($e["score"])) {
if (isset($e["score"]["d"]) && $e["score"]["d"]) {
$e["status"] = "OK";
} else {
$e["status"] = "NG";
}
}
$e["tltime"] = preg_replace("/\\//", "-", $e["date"]) . "T" . $e["time"];
$es[] = $e;
}
}
//echo ("setColor('green');\n");
foreach ($es as $e) {
//if (!$e["isError"]) {
$tltime = $e["tltime"];
$fname = LogUtil::getFileName($e);
$status = $e["status"];
echo "showLine('{$tltime}','{$fname}','{$status}');\n";
//}
}
/*foreach($es as $e) {
if ($e["isError"]) {
$tltime=$e["tltime"];
$fname=LogUtil::getFileName($e);
//echo ("setColor('red');\n");
echo("showLine('$tltime','$fname');\n");
} else if (isset($e["score"])) {
if (isset($e["score"]["d"]) && $e["score"]["d"]) {
echo ("setColor('blue');\n");
} else {
echo ("setColor('yellow');\n");
}
echo("showLine('$tltime','$fname');\n");
}
} */
echo "});</script>\n";
}