Add parameter for ODBC IBM i driver name.

This commit is contained in:
Maxime Rault 2016-05-04 09:17:24 +02:00
parent 79c3cf22d0
commit f753156019
3 changed files with 16 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class ODBCConnector extends Connector implements ConnectorInterface
$dsn = "odbc:"
// General settings
. "DRIVER={iSeries Access ODBC Driver};"
. "DRIVER=$name;"
. "SYSTEM=$host;"
. "UserID=$username;"
. "Password=$password;"

View File

@ -45,7 +45,7 @@ class DB2ServiceProvider extends ServiceProvider {
{
//Only use configurations that feature a "odbc" or "ibm" driver
if(!isset($config['driver']) || !in_array($config['driver'], ['odbc', 'ibm']) )
if(!isset($config['type']) || !in_array($config['type'], ['odbc', 'ibm']) )
{
continue;
}
@ -53,7 +53,7 @@ class DB2ServiceProvider extends ServiceProvider {
//Create a connector
$this->app['db']->extend($conn, function($config)
{
switch ($config['driver']) {
switch ($config['type']) {
case 'odbc':
$connector = new ODBCConnector();
break;

View File

@ -56,13 +56,13 @@ PDO::CASE_NATURAL
*/
return [
'connections' => [
'ibmi' => [
'driver' => 'odbc' / 'ibm',
'type' => 'odbc' / 'ibm',
'name' => '{IBM i Access ODBC Driver}' / '{iSeries Access ODBC Driver}',
// General settings
'host' => 'server',
'username' => '',
@ -131,6 +131,17 @@ return [
PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_PERSISTENT => false
],
'toolkit' => [
'XMLServiceLib' => 'XMLSERVICE',
'debug' => false,
'debugLogFile' => storage_path() . '/logs/toolkit.log',
'InternalKey' => '/tmp/' . 'Toolkit_' . app()->environment() . '_' . rand(1, 10),
'stateless' => false,
'plugSize' => '4K',
'ccsidBefore' => "819/1147",
'ccsidAfter' => "1147/819",
'useHex' => true
]
],