- Модуль: perfmon
- Путь к файлу: ~/bitrix/modules/perfmon/classes/general/query.php
- Класс: CPerfQueryTable
- Вызов: CPerfQueryTable::parse
function parse($sql)
{
$sql = CPerfQuery::removeSpaces($sql);
$match = array();
if (preg_match("/^([`"\[\]]{0,1}[a-z0-9_]+[`"\[\]]{0,1}) ([`"\[\]]{0,1}[a-z0-9_]+[`"\[\]]{0,1}) on (.+)$/i", $sql, $match))
{
$this->name = $match[1];
$this->alias = $match[2];
$this->join = $match[3];
}
if (preg_match("/^([`"\[\]]{0,1}[a-zA-Z0-9_]+[`"\[\]]{0,1}) ([`"\[\]]{0,1}[a-zA-Z0-9_]+[`"\[\]]{0,1})($| )/", $sql, $match))
{
$this->name = $match[1];
$this->alias = $match[2];
}
elseif (preg_match("/^([`"\[\]]{0,1}[a-zA-Z0-9_]+[`"\[\]]{0,1})$/", $sql, $match))
{
$this->name = $match[1];
$this->alias = $this->name;
}
else
{
return false;
}
$this->sql = $sql;
return true;
}