public function FrxMSSQL::__construct in Forena Reports 7.3
Same name and namespace in other branches
- 6.2 plugins/FrxMSSQL.inc \FrxMSSQL::__construct()
- 6 plugins/FrxMSSQL.inc \FrxMSSQL::__construct()
- 7 plugins/FrxMSSQL.inc \FrxMSSQL::__construct()
- 7.2 plugins/FrxMSSQL.inc \FrxMSSQL::__construct()
- 7.4 plugins/FrxMSSQL.inc \FrxMSSQL::__construct()
Object constructor
Parameters
unknown_type $uri Database connection string.:
string $repos_path Path to location of data block definitions:
Overrides FrxDataSource::__construct
File
- plugins/
FrxMSSQL.inc, line 22 - Oracle specific driver that takes advantage of oracles native XML support
Class
- FrxMSSQL
- @file Oracle specific driver that takes advantage of oracles native XML support
Code
public function __construct($conf, $repos_path, $name) {
parent::__construct($conf, $repos_path, $name);
$this->use_mssql_xml = FALSE;
$uri = $conf['uri'];
$this->debug = $conf['debug'];
if ($conf['mssql_xml']) {
$this->use_mssql_xml = TRUE;
}
if ($uri) {
// Test for mssql suport
if (!is_callable('mssql_connect')) {
FrxReportGenerator::instance()
->error('MSSQL support not installed.', 'MSSQL mssql support not installed.');
return;
}
try {
ini_set('mssql.textlimit', 2147483647);
ini_set('mssql.textsize', 2147483647);
$db = mssql_connect($uri, $conf['user'], $conf['password']);
$this->db = $db;
if ($db) {
mssql_select_db($conf['database'], $db);
mssql_query("SET QUOTED_IDENTIFIER ON");
}
} catch (Exception $e) {
FrxReportGenerator::instance()
->error('Unable to connect to database ' . $conf['title'], $e
->getMessage());
}
}
else {
FrxReportGenerator::instance()
->error('No database connection string specified', 'No database connection: ' . print_r($conf, 1));
}
// Set up the stuff required to translate.
$this->te = new FrxSyntaxEngine(FRX_SQL_TOKEN, ':', $this);
}