Download the PHP package kokspflanze/pdo-dblib-module without Composer
On this page you can find all versions of the php package kokspflanze/pdo-dblib-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kokspflanze/pdo-dblib-module
More information about kokspflanze/pdo-dblib-module
Files in kokspflanze/pdo-dblib-module
Informations about the package pdo-dblib-module
PDODblibModule
PDO DBlib Module for Zend 2
Introduction
Doctrine 2 does support any method of connecting to SQL Server on a Linux box. Here's a simple driver that supports PDO DBlib. Many tests fail, but most are related to shortcomings of the PDODBlib driver. There is a patch in the PHP repo to add transaction and lastInsertId support, but this package has some minor work arounds.
Dependecies
- pdo_dblib
- FreeTDS
- DoctrineModule
- DoctrineORMModule
For Symphony Bundle: [PDODblibBundle] (https://github.com/trooney/PDODblibBundle) (latest master)
FreeTDS configuration
DBLib requires FreeTDS. We can't go into detail about configuring FreeTDS, but the connection configured should look something like following:
Installing
With composer
-
Add this in your composer.json:
- Now tell composer to download PDODblibModule by running the command:
Post Installation
-
Enabling it in your
application.config.php
file. - Add this to your autoload folder
Putting everything together
Getting everything together wasn't easy. You need to complete the following steps, checking each installation is successful by connecting with the appropriate tools:
- Install FreeTDS and configure a server connection
- Verify with ./tsql -S mssql_freetds -U yourusername -P yourpassword
- Install the PHP DBLib extension -- verify with PHP script containing
- Verify $pdo = new PDO('dblib:host=mssql_freetds;dbname=yourdb', 'yourusername', 'yourpassword');
- Install and configure the PDODblibBundle
- Verify Some kind of SQL against your database
FYI - PHP pdo_dblib patch
You can find a patch for some of the short-comings of pdo_dblib on SVN.
http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo_dblib/dblib_driver.c?view=log
See: Revision 300647 - lastInsertId Revision 300628 - transaction support
FYI - Doctrine Test Suite
Doctrine2's test suite does not allow you to add database drivers on the fly. If you want to test this package, modify Doctrine/DBAL/Driver/DriverManager::$_driverMap
as follows:
FYI - Generating Entities from database
It's possible, but not easy. Here's what I did:
- Map any non-compatible column types to string
- Hack the Doctrine core to skip any tables without primary keys