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:" $dsn = "odbc:"
// General settings // General settings
. "DRIVER={iSeries Access ODBC Driver};" . "DRIVER=$name;"
. "SYSTEM=$host;" . "SYSTEM=$host;"
. "UserID=$username;" . "UserID=$username;"
. "Password=$password;" . "Password=$password;"

View File

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

View File

@ -56,13 +56,13 @@ PDO::CASE_NATURAL
*/ */
return [ return [
'connections' => [ 'connections' => [
'ibmi' => [ 'ibmi' => [
'driver' => 'odbc' / 'ibm', 'type' => 'odbc' / 'ibm',
'name' => '{IBM i Access ODBC Driver}' / '{iSeries Access ODBC Driver}',
// General settings // General settings
'host' => 'server', 'host' => 'server',
'username' => '', 'username' => '',
@ -131,6 +131,17 @@ return [
PDO::ATTR_CASE => PDO::CASE_LOWER, PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_PERSISTENT => 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
] ]
], ],