本文整理汇总了PHP中Tracy\Debugger::getBluescreen方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::getBluescreen方法的具体用法?PHP Debugger::getBluescreen怎么用?PHP Debugger::getBluescreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Debugger
的用法示例。
在下文中一共展示了Debugger::getBluescreen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logQuery
public function logQuery(Nette\Database\Connection $connection, $result)
{
if ($this->disabled) {
return;
}
$this->count++;
$source = NULL;
$trace = $result instanceof \PDOException ? $result->getTrace() : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
foreach ($trace as $row) {
if (isset($row['file']) && is_file($row['file']) && !Tracy\Debugger::getBluescreen()->isCollapsed($row['file'])) {
if (isset($row['function']) && strpos($row['function'], 'call_user_func') === 0 || isset($row['class']) && is_subclass_of($row['class'], '\\Nette\\Database\\Connection')) {
continue;
}
$source = [$row['file'], (int) $row['line']];
break;
}
}
if ($result instanceof Nette\Database\ResultSet) {
$this->totalTime += $result->getTime();
if ($this->count < $this->maxQueries) {
$this->queries[] = [$connection, $result->getQueryString(), $result->getParameters(), $source, $result->getTime(), $result->getRowCount(), NULL];
}
} elseif ($result instanceof \PDOException && $this->count < $this->maxQueries) {
$this->queries[] = [$connection, $result->queryString, NULL, $source, NULL, NULL, $result->getMessage()];
}
}
示例2: logQuery
public function logQuery(Connection $connection, $result)
{
if (!$result instanceof ResultSet) {
return;
}
$queryString = $result->getQueryString();
if (Strings::startsWith($queryString, 'EXPLAIN')) {
return;
}
$source = NULL;
$trace = $result instanceof \PDOException ? $result->getTrace() : debug_backtrace(PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_IGNORE_ARGS : FALSE);
foreach ($trace as $row) {
if (isset($row['file']) && is_file($row['file']) && !Debugger::getBluescreen()->isCollapsed($row['file'])) {
if (isset($row['function']) && strpos($row['function'], 'call_user_func') === 0 || isset($row['class']) && is_subclass_of($row['class'], '\\Nette\\Database\\Connection')) {
continue;
}
$source = array($row['file'], (int) $row['line']);
break;
}
}
$sqlQuery = Helpers::dumpSql($queryString, $result->getParameters(), $connection);
$this->queries[$sqlQuery][] = array($sqlQuery, $source);
}
示例3: findSource
/**
* Use a backtrace to search for the origin of the query.
*/
public static function findSource()
{
$source = null;
$trace = debug_backtrace(PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_IGNORE_ARGS : false);
foreach ($trace as $row) {
if (isset($row['file']) === true && Debugger::getBluescreen()->isCollapsed($row['file']) === false) {
if (isset($row['function']) && strpos($row['function'], 'call_user_func') === 0 || isset($row['class']) && is_subclass_of($row['class'], '\\Illuminate\\Database\\Connection')) {
continue;
}
return $source = [$row['file'], (int) $row['line']];
}
}
return $source;
}