• Модуль: perfmon
  • Путь к файлу: ~/bitrix/modules/perfmon/classes/general/keeper.php
  • Класс: CPerfomanceKeeper
  • Вызов: CPerfomanceKeeper::findCaller
static function findCaller($trace, &$module_id, &$comp_id)
{
	$module_id = false;
	$comp_id = false;
	foreach ($trace as $i => $arCallInfo)
	{
		if (array_key_exists("file", $arCallInfo))
		{
			$file = mb_strtolower(str_replace("\", "/", $arCallInfo["file"]));

			if (
				!$module_id
				&& !preg_match("/\/(database|cache|managedcache)\.php$/", $file)
			)
			{
				$match = array();
				if (preg_match("#.*/bitrix/modules/(.+?)/#", $file, $match))
				{
					$module_id = $match[1];
				}
			}

			$match = array();
			if (
				!$comp_id
				&& preg_match("#.*/(?:bitrix|install)/components/(.+?)/(.+?)/#", $file, $match)
			)
			{
				$comp_id = $match[1].":".$match[2];
			}

			if ($module_id && $comp_id)
				break;
		}
	}
}