PHPackages                             wiz/pdodblib-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. wiz/pdodblib-bundle

ActiveLibrary[Database &amp; ORM](/categories/database)

wiz/pdodblib-bundle
===================

PDO DBlib Driver for Symfony

048PHP

Since Feb 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lamjack/PDODblibBundle)[ Packagist](https://packagist.org/packages/wiz/pdodblib-bundle)[ RSS](/packages/wiz-pdodblib-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PDODblibBundle
--------------

[](#pdodblibbundle)

This PDO DBLib bundle adds support for Microsoft SQL Server Doctrine 2. Take it with a grain of salt: Many of the Doctrine unit tests fail when using this driver. PHP's PDO\_DBLIB driver does not support many of the features within doctrine. There is a patch in the PHP repo to add transaction and lastInsertId support, but this package has some minor work arounds.

This bundle requires the following:

- pdo\_dblib
- FreeTDS

FreeTDS configuration
=====================

[](#freetds-configuration)

DBLib requires FreeTDS. We can't go into detail about configuring FreeTDS, but the connection configured should look something like following:

```
[mssql_freetds]
    host = 192.168.1.1
    port = 1433
    tds version = 8.0
    client charset = UTF-8
    text size = 20971520

```

Setting up bundle in Symfony
============================

[](#setting-up-bundle-in-symfony)

In your Symfony2 project, modify your `config.yml` as follows to use the DBlib bundle and the server setup under FreeTDS:

```
# Doctrine Configuration
doctrine:
    dbal:
        driver_class:   PDODblibBundle\Doctrine\DBAL\Driver\PDODblib\Driver
        host:           mssql_freetds
```

And in your `autoload.php` register the new bundle:

```
$loader->registerNamespaces(array(
    'PDODblib'         => __DIR__ . '/../vendor/bundles',
));
```

Putting everything together
===========================

[](#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
==========================

[](#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](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
=========================

[](#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`:

```
final class DriverManager
{
    private static $_driverMap = array(
		/* ... snip ... */
        'pdo_dblib' => 'Doctrine\DBAL\Driver\PDODblib\Driver',
    );
}
```

FYI - Generating Entities from database
=======================================

[](#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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/179f6abf573a32310894eb72a412915e024ca1c29765c731741b74ee4e9d11e9?d=identicon)[wizmacau](/maintainers/wizmacau)

---

Top Contributors

[![trooney](https://avatars.githubusercontent.com/u/303015?v=4)](https://github.com/trooney "trooney (9 commits)")[![DerManoMann](https://avatars.githubusercontent.com/u/47783?v=4)](https://github.com/DerManoMann "DerManoMann (3 commits)")[![arnolanglade](https://avatars.githubusercontent.com/u/3585922?v=4)](https://github.com/arnolanglade "arnolanglade (1 commits)")[![lamjack](https://avatars.githubusercontent.com/u/8164447?v=4)](https://github.com/lamjack "lamjack (1 commits)")[![mabuzagu](https://avatars.githubusercontent.com/u/459106?v=4)](https://github.com/mabuzagu "mabuzagu (1 commits)")

### Embed Badge

![Health badge](/badges/wiz-pdodblib-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/wiz-pdodblib-bundle/health.svg)](https://phpackages.com/packages/wiz-pdodblib-bundle)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
