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)
|
protected function getDsn(array $config)
|
||||||
{
|
{
|
||||||
$dsnParts = [
|
extract($config);
|
||||||
'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
|
|
||||||
];
|
|
||||||
|
|
||||||
$dsnConfig = [
|
$dsn = "odbc:"
|
||||||
// General settings
|
// General settings
|
||||||
$config['driverName'], $config['host'], $config['username'], $config['password'],
|
. "DRIVER=$driverName;"
|
||||||
|
. "SYSTEM=$host;"
|
||||||
|
. "UserID=$username;"
|
||||||
|
. "Password=$password;"
|
||||||
//Server settings
|
//Server settings
|
||||||
$config['database'], $config['signon'], $config['ssl'], $config['commitMode'], $config['connectionType'],
|
. "DATABASE=$database;"
|
||||||
$config['defaultLibraries'], $config['naming'], $config['unicodeSql'],
|
. "SIGNON=$signon;"
|
||||||
|
. "SSL=$ssl;"
|
||||||
|
. "CommitMode=$commitMode;"
|
||||||
|
. "ConnectionType=$connectionType;"
|
||||||
|
. "DefaultLibraries=$defaultLibraries;"
|
||||||
|
. "Naming=$naming;"
|
||||||
|
. "UNICODESQL=$unicodeSql;"
|
||||||
// Format settings
|
// Format settings
|
||||||
$config['dateFormat'], $config['dateSeperator'], $config['decimal'], $config['timeFormat'],
|
. "DateFormat=$dateFormat;"
|
||||||
$config['timeSeparator'],
|
. "DateSeperator=$dateSeperator;"
|
||||||
|
. "Decimal=$decimal;"
|
||||||
|
. "TimeFormat=$timeFormat;"
|
||||||
|
. "TimeSeparator=$timeSeparator;"
|
||||||
// Performances settings
|
// Performances settings
|
||||||
$config['blockFetch'], $config['blockSizeKB'], $config['allowDataCompression'], $config['concurrency'],
|
. "BLOCKFETCH=$blockFetch;"
|
||||||
$config['lazyClose'], $config['maxFieldLength'], $config['prefetch'], $config['queryTimeout'],
|
. "BlockSizeKB=$blockSizeKB;"
|
||||||
|
. "AllowDataCompression=$allowDataCompression;"
|
||||||
|
. "CONCURRENCY=$concurrency;"
|
||||||
|
. "LAZYCLOSE=$lazyClose;"
|
||||||
|
. "MaxFieldLength=$maxFieldLength;"
|
||||||
|
. "PREFETCH=$prefetch;"
|
||||||
|
. "QUERYTIMEOUT=$queryTimeout;"
|
||||||
// Modules settings
|
// Modules settings
|
||||||
$config['defaultPkgLibrary'], $config['defaultPackage'], $config['extendedDynamic'],
|
. "DefaultPkgLibrary=$defaultPkgLibrary;"
|
||||||
|
. "DefaultPackage=$defaultPackage;"
|
||||||
|
. "ExtendedDynamic=$extendedDynamic;"
|
||||||
// Diagnostic settings
|
// Diagnostic settings
|
||||||
$config['QAQQINILibrary'], $config['sqDiagCode'],
|
. "QAQQINILibrary=$QAQQINILibrary;"
|
||||||
|
. "SQDIAGCODE=$sqDiagCode;"
|
||||||
// Sort settings
|
// Sort settings
|
||||||
$config['languageId'], $config['sortTable'], $config['sortSequence'], $config['sortWeight'],
|
. "LANGUAGEID=$languageId;"
|
||||||
|
. "SORTTABLE=$sortTable;"
|
||||||
|
. "SortSequence=$sortSequence;"
|
||||||
|
. "SORTWEIGHT=$sortWeight;"
|
||||||
// Conversion settings
|
// Conversion settings
|
||||||
$config['allowUnsupportedChar'], $config['ccsid'], $config['graphic'], $config['forceTranslation'],
|
. "AllowUnsupportedChar=$allowUnsupportedChar;"
|
||||||
|
. "CCSID=$ccsid;"
|
||||||
|
. "GRAPHIC=$graphic;"
|
||||||
|
. "ForceTranslation=$forceTranslation;"
|
||||||
// Other settings
|
// Other settings
|
||||||
$config['allowProcCalls'], $config['DB2SqlStates'], $config['debug'], $config['trueAutoCommit'],
|
. "ALLOWPROCCALLS=$allowProcCalls;"
|
||||||
$config['catalogOptions'], $config['libraryView'], $config['ODBCRemarks'], $config['searchPattern'],
|
. "DB2SQLSTATES=$DB2SqlStates;"
|
||||||
$config['translationDLL'], $config['translationOption'], $config['maxTraceSize'],
|
. "DEBUG=$debug;"
|
||||||
$config['multipleTraceFiles'], $config['trace'], $config['traceFilename'], $config['extendedColInfo'],
|
. "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