laravel-db2
laravel-db2 copied to clipboard
Using package on windows with ODBC manager
Hiya,
Great package you have here!
I am using the odbc manager from within windows to setup the connection the ODBC driver. However this packages needs the configuration for:
'System=%s',
'Database=%s',
'UserID=%s',
'Password=%s',
in ODBCConnector.php
I only need the "odbc" option within this connector.
The idea is to allow 2 extra settings to be specified in the config file:
'windows_odbc_defined' => true,
'windows_odbc_name' => 'name'
When these settings are specified the odbc connector will make the odbc connection based on what is specified.
Changes in ODBCConnector.php
:
if ($config['windows_odbc_defined'] == true) {
$dsnParts = [
'odbc:%s'
];
$dsnConfig = [
$config['windows_odbc_name']
];
} else {
$dsnParts = [
'odbc:DRIVER=%s',
'System=%s',
'Database=%s',
'UserID=%s',
'Password=%s',
];
$dsnConfig = [
$config['driverName'],
$config['host'],
$config['database'],
$config['username'],
$config['password'],
];
}