protected final function execSQLScript($name, $module = null, $inTransaction = true)
{
$conn = $this->dbConnection();
$tools = $this->dbTool();
if ($module) {
$conf = $this->entryPoint->getConfigObj()->_modulesPathList;
if (!isset($conf[$module])) {
throw new Exception('execSQLScript : invalid module name');
}
$path = $conf[$module];
} else {
$path = $this->path;
}
$file = $path . 'install/' . $name;
if (substr($name, -4) != '.sql') {
$file .= '.' . $conn->dbms . '.sql';
}
if ($inTransaction) {
$conn->beginTransaction();
}
try {
$tools->execSQLScript($file);
if ($inTransaction) {
$conn->commit();
}
} catch (\Exception $e) {
if ($inTransaction) {
$conn->rollback();
}
throw $e;
}
}