• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/mysqldbconnection.php
  • Класс: BitrixMainDBMysqlDbConnection
  • Вызов: MysqlDbConnection::connectInternal
protected function connectInternal()
{
	if ($this->isConnected)
		return;

	if (($this->dbOptions & self::PERSISTENT) != 0)
		$connection = mysql_pconnect($this->dbHost, $this->dbLogin, $this->dbPassword);
	else
		$connection = mysql_connect($this->dbHost, $this->dbLogin, $this->dbPassword, true);

	if (!$connection)
		throw new ConnectionException('Mysql connect error', mysql_error());

	if (!mysql_select_db($this->dbName, $connection))
		throw new ConnectionException('Mysql select db error', mysql_error($connection));

	$this->resource = $connection;
	$this->isConnected = true;

	if ($fn = BitrixMainLoader::getPersonal("php_interface/after_connect_d7.php"))
		include($fn);
}