Issues

ZF-11898: Zend_Db_Adapter_Pdo_Mssql changes to work with php_pdo_sqlsrv extension

Issue Type: Improvement Created: 2011-11-17T23:16:46.000+0000 Last Updated: 2011-11-30T14:28:56.000+0000 Status: Open Fix version(s): Reporter: Andrey Kulikov (andkul) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

  • state:need-feedback

Related issues: Attachments:

Description

in file Zend_Db_Adapter_Pdo_Mssql in method _dsn() put this changes

<pre class="highlight">
            switch (strtolower($dsn['pdoType'])) {
                case 'freetds':
                case 'sybase':
                    $this->_pdoType = 'sybase';
                    break;
                case 'mssql':
                    $this->_pdoType = 'mssql';
                    break;
                case 'sqlsrv':
                    $this->_pdoType = 'sqlsrv';
                    unset($dsn['charset']);
                    break;
                case 'dblib':
                default:
                    $this->_pdoType = 'dblib';
                    break;
            }
            unset($dsn['pdoType']);
        }

        // use all remaining parts in the DSN
        foreach ($dsn as $key => $val) {
            if($key == 'dbname' && $this->_pdoType == 'sqlsrv'){
                $dsn[$key] = "Database=$val";
            } elseif($key == 'host' && $this->_pdoType == 'sqlsrv'){
                $dsn[$key] = "server=$val";
            }else {
                $dsn[$key] = "$key=$val";
            }
        }

Comments

Posted by Adam Lundrigan (adamlundrigan) on 2011-11-18T15:04:57.000+0000

It appears to me that PDO_SQLSRV uses different DSN component names than the other SQL Server PDO drivers. Would it be better to implement PDO_SQLSRV separately (ie: Zend_Db_Adapter_Pdo_Sqlsrv) than doing the DSN key translations in the existing adapter? PDO_SQLSRV also has many extra DNS parts that PDO_DBLIB/PDO_MSSQL don't.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts