• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/diag/sqltrackerquery.php
  • Класс: BitrixMainDiagSqlTrackerQuery
  • Вызов: SqlTrackerQuery::filterTrace
protected function filterTrace($trace)
{
	$filtered = array();
	foreach ($trace as $i => $tr)
	{
		$args = array();
		if (!empty($tr["args"]) && is_array($tr["args"]))
		{
			foreach ($tr["args"] as $k1 => $v1)
			{
				if (is_array($v1))
				{
					foreach ($v1 as $k2 => $v2)
					{
						if (is_scalar($v2))
						{
							$args[$k1][$k2] = $v2;
						}
						elseif (is_object($v2))
						{
							$args[$k1][$k2] = get_class($v2);
						}
						else
						{
							$args[$k1][$k2] = gettype($v2);
						}
					}
				}
				else
				{
					if (is_scalar($v1))
					{
						$args[$k1] = $v1;
					}
					elseif (is_object($v1))
					{
						$args[$k1] = get_class($v1);
					}
					else
					{
						$args[$k1] = gettype($v1);
					}
				}
			}
		}

		$filtered[] = [
			"file" => $tr["file"] ?? null,
			"line" => $tr["line"] ?? null,
			"class" => $tr["class"] ?? null,
			"type" => $tr["type"] ?? null,
			"function" => $tr["function"] ?? null,
			"args" => $args,
		];
	}
	return $filtered;
}