Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using package on windows with ODBC manager #47

Open
NoxxieNl opened this issue Jan 22, 2019 · 0 comments
Open

Using package on windows with ODBC manager #47

NoxxieNl opened this issue Jan 22, 2019 · 0 comments

Comments

@NoxxieNl
Copy link

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'],
            ];
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant