Fix syntax
This commit is contained in:
parent
0f5cbff09d
commit
e26b9b4bcb
@ -40,47 +40,73 @@ class ODBCConnector extends Connector implements ConnectorInterface
|
||||
*/
|
||||
protected function getDsn(array $config)
|
||||
{
|
||||
$dsnParts = [
|
||||
'odbc:DRIVER=%s', 'SYSTEM=%s', 'UserID=%s', 'Password=%s', 'DATABASE=%s', 'SIGNON=%s', 'SSL=%s',
|
||||
'CommitMode=%s', 'ConnectionType=%s', 'DefaultLibraries=%s', 'Naming=%s', 'UNICODESQL=%s', 'DateFormat=%s',
|
||||
'DateSeperator=%s', 'Decimal=%s', 'TimeFormat=%s', 'TimeSeparator=%s', 'BLOCKFETCH=%s', 'BlockSizeKB=%s',
|
||||
'AllowDataCompression=%s', 'CONCURRENCY=%s', 'LAZYCLOSE=%s', 'MaxFieldLength=%s', 'PREFETCH=%s',
|
||||
'QUERYTIMEOUT=%s', 'DefaultPkgLibrary=%s', 'DefaultPackage=%s', 'ExtendedDynamic=%s', 'QAQQINILibrary=%s',
|
||||
'SQDIAGCODE=%s', 'LANGUAGEID=%s', 'SORTTABLE=%s', 'SortSequence=%s', 'SORTWEIGHT=%s',
|
||||
'AllowUnsupportedChar=%s', 'CCSID=%s', 'GRAPHIC=%s', 'ForceTranslation=%s', 'ALLOWPROCCALLS=%s',
|
||||
'DB2SQLSTATES=%s', 'DEBUG=%s', 'TRUEAUTOCOMMIT=%s', 'CATALOGOPTIONS=%s', 'LibraryView=%s', 'ODBCRemarks=%s',
|
||||
'SEARCHPATTERN=%s', 'TranslationDLL=%s', 'TranslationOption=%s', 'MAXTRACESIZE=%s', 'MultipleTraceFiles=%s',
|
||||
'TRACE=%s', 'TRACEFILENAME=%s', 'ExtendedColInfo=%s',
|
||||
'', // Just to add a semicolon to the end of string
|
||||
];
|
||||
extract($config);
|
||||
|
||||
$dsnConfig = [
|
||||
$dsn = "odbc:"
|
||||
// General settings
|
||||
$config['driverName'], $config['host'], $config['username'], $config['password'],
|
||||
. "DRIVER=$driverName;"
|
||||
. "SYSTEM=$host;"
|
||||
. "UserID=$username;"
|
||||
. "Password=$password;"
|
||||
//Server settings
|
||||
$config['database'], $config['signon'], $config['ssl'], $config['commitMode'], $config['connectionType'],
|
||||
$config['defaultLibraries'], $config['naming'], $config['unicodeSql'],
|
||||
. "DATABASE=$database;"
|
||||
. "SIGNON=$signon;"
|
||||
. "SSL=$ssl;"
|
||||
. "CommitMode=$commitMode;"
|
||||
. "ConnectionType=$connectionType;"
|
||||
. "DefaultLibraries=$defaultLibraries;"
|
||||
. "Naming=$naming;"
|
||||
. "UNICODESQL=$unicodeSql;"
|
||||
// Format settings
|
||||
$config['dateFormat'], $config['dateSeperator'], $config['decimal'], $config['timeFormat'],
|
||||
$config['timeSeparator'],
|
||||
. "DateFormat=$dateFormat;"
|
||||
. "DateSeperator=$dateSeperator;"
|
||||
. "Decimal=$decimal;"
|
||||
. "TimeFormat=$timeFormat;"
|
||||
. "TimeSeparator=$timeSeparator;"
|
||||
// Performances settings
|
||||
$config['blockFetch'], $config['blockSizeKB'], $config['allowDataCompression'], $config['concurrency'],
|
||||
$config['lazyClose'], $config['maxFieldLength'], $config['prefetch'], $config['queryTimeout'],
|
||||
. "BLOCKFETCH=$blockFetch;"
|
||||
. "BlockSizeKB=$blockSizeKB;"
|
||||
. "AllowDataCompression=$allowDataCompression;"
|
||||
. "CONCURRENCY=$concurrency;"
|
||||
. "LAZYCLOSE=$lazyClose;"
|
||||
. "MaxFieldLength=$maxFieldLength;"
|
||||
. "PREFETCH=$prefetch;"
|
||||
. "QUERYTIMEOUT=$queryTimeout;"
|
||||
// Modules settings
|
||||
$config['defaultPkgLibrary'], $config['defaultPackage'], $config['extendedDynamic'],
|
||||
. "DefaultPkgLibrary=$defaultPkgLibrary;"
|
||||
. "DefaultPackage=$defaultPackage;"
|
||||
. "ExtendedDynamic=$extendedDynamic;"
|
||||
// Diagnostic settings
|
||||
$config['QAQQINILibrary'], $config['sqDiagCode'],
|
||||
. "QAQQINILibrary=$QAQQINILibrary;"
|
||||
. "SQDIAGCODE=$sqDiagCode;"
|
||||
// Sort settings
|
||||
$config['languageId'], $config['sortTable'], $config['sortSequence'], $config['sortWeight'],
|
||||
. "LANGUAGEID=$languageId;"
|
||||
. "SORTTABLE=$sortTable;"
|
||||
. "SortSequence=$sortSequence;"
|
||||
. "SORTWEIGHT=$sortWeight;"
|
||||
// Conversion settings
|
||||
$config['allowUnsupportedChar'], $config['ccsid'], $config['graphic'], $config['forceTranslation'],
|
||||
. "AllowUnsupportedChar=$allowUnsupportedChar;"
|
||||
. "CCSID=$ccsid;"
|
||||
. "GRAPHIC=$graphic;"
|
||||
. "ForceTranslation=$forceTranslation;"
|
||||
// Other settings
|
||||
$config['allowProcCalls'], $config['DB2SqlStates'], $config['debug'], $config['trueAutoCommit'],
|
||||
$config['catalogOptions'], $config['libraryView'], $config['ODBCRemarks'], $config['searchPattern'],
|
||||
$config['translationDLL'], $config['translationOption'], $config['maxTraceSize'],
|
||||
$config['multipleTraceFiles'], $config['trace'], $config['traceFilename'], $config['extendedColInfo'],
|
||||
];
|
||||
. "ALLOWPROCCALLS=$allowProcCalls;"
|
||||
. "DB2SQLSTATES=$DB2SqlStates;"
|
||||
. "DEBUG=$debug;"
|
||||
. "TRUEAUTOCOMMIT=$trueAutoCommit;"
|
||||
. "CATALOGOPTIONS=$catalogOptions;"
|
||||
. "LibraryView=$libraryView;"
|
||||
. "ODBCRemarks=$ODBCRemarks;"
|
||||
. "SEARCHPATTERN=$searchPattern;"
|
||||
. "TranslationDLL=$translationDLL;"
|
||||
. "TranslationOption=$translationOption;"
|
||||
. "MAXTRACESIZE=$maxTraceSize;"
|
||||
. "MultipleTraceFiles=$multipleTraceFiles;"
|
||||
. "TRACE=$trace;"
|
||||
. "TRACEFILENAME=$traceFilename;"
|
||||
. "ExtendedColInfo=$extendedColInfo;"
|
||||
;
|
||||
|
||||
return sprintf(implode(';', $dsnParts), ...$dsnConfig);
|
||||
return $dsn;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user