本文整理汇总了PHP中Wikia::debugBacktrace方法的典型用法代码示例。如果您正苦于以下问题:PHP Wikia::debugBacktrace方法的具体用法?PHP Wikia::debugBacktrace怎么用?PHP Wikia::debugBacktrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wikia
的用法示例。
在下文中一共展示了Wikia::debugBacktrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doQuery
/**
* @param $sql string
* @return true|false|resource
*
* For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
* For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.
*/
protected function doQuery($sql)
{
$this->installErrorHandler();
if ($this->bufferResults()) {
$ret = mysql_query($sql, $this->mConn);
} else {
$ret = mysql_unbuffered_query($sql, $this->mConn);
}
$phpError = $this->restoreErrorHandler();
if ($ret === false) {
global $wgDBname;
$error = $this->lastError();
if (!$error) {
$error = $phpError;
}
$err_num = $this->lastErrno();
error_log(sprintf("SQL (%s): %d: %s", $wgDBname, $err_num, $error));
error_log("SQL: invalid query: {$sql}");
# Wikia change - begin
switch ($err_num) {
case 1213:
/* deadlock*/
error_log("MOLI: deadlock: {$error} ");
Wikia::debugBacktrace("MOLI: Deadlock:");
break;
case 2006:
/* server has gone away */
error_log("MOLI: gone away: {$error} ");
Wikia::debugBacktrace("MOLI: gone away:");
break;
}
# Wikia change - end
}
return $ret;
}
示例2: doQuery
/**
* @param $sql string
* @return resource
*/
protected function doQuery($sql)
{
$this->installErrorHandler();
if ($this->bufferResults()) {
$ret = mysql_query($sql, $this->mConn);
} else {
$ret = mysql_unbuffered_query($sql, $this->mConn);
}
$phpError = $this->restoreErrorHandler();
if ($ret === false) {
global $wgDBname;
$error = $this->lastError();
if (!$error) {
$error = $phpError;
}
$err_num = $this->lastErrno();
error_log(sprintf("SQL (%s): %d: %s", $wgDBname, $err_num, $error));
error_log("SQL: invalid query: {$sql}");
if ($err_num == 1213) {
/* deadlock*/
error_log("MOLI: deadlock: {$error} ");
Wikia::debugBacktrace("MOLI: Deadlock:");
}
}
return $ret;
}