PHPackages                             contaoblackforest/contao-doctrine-dbal-driver - 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. contaoblackforest/contao-doctrine-dbal-driver

ActiveContao-module[Database &amp; ORM](/categories/database)

contaoblackforest/contao-doctrine-dbal-driver
=============================================

Database Driver using Doctrine DBAL for Contao Open Source CMS

3.2.2(10y ago)0161LGPL-3.0+PHPPHP &gt;=5.3

Since Jun 4Pushed 10y ago2 watchersCompare

[ Source](https://github.com/ContaoBlackForest/contao-doctrine-dbal-driver)[ Packagist](https://packagist.org/packages/contaoblackforest/contao-doctrine-dbal-driver)[ RSS](/packages/contaoblackforest-contao-doctrine-dbal-driver/feed)WikiDiscussions contao-3.2 Synced 1mo ago

READMEChangelogDependencies (3)Versions (55)Used By (0)

Doctrine Database Driver for Contao
===================================

[](#doctrine-database-driver-for-contao)

To use this database driver, change the driver in your `system/config/localconfig.php`:

```
$GLOBALS['TL_CONFIG']['dbDriver'] = 'DoctrineMySQL';
```

Configure caching
-----------------

[](#configure-caching)

By default, the driver use an array cache (equivalent to contao). But the caching can be configured with `$GLOBALS['TL_CONFIG']['dbCache']`, `$GLOBALS['TL_CONFIG']['dbCacheTTL']` and `$GLOBALS['TL_CONFIG']['dbCacheName']`.

`$GLOBALS['TL_CONFIG']['dbCache']` define the caching mechanism, possible values are:

apcuse apc cachexcacheuse xcache cachememcache://&lt;host&gt;\[:&lt;port&gt;\]use memcache cache on &lt;host&gt;:&lt;port&gt;redis://&lt;host&gt;\[:&lt;port&gt;\]use redis cache on &lt;host&gt;:&lt;port&gt;redis://&lt;socket&gt;use redis cache on &lt;socket&gt; filearrayuse array cachefalsedisable the cache`$GLOBALS['TL_CONFIG']['dbCacheTTL']` is an integer value, that define the *time to live*(default value is 1 second for backend and 15 second for frontend).

`$GLOBALS['TL_CONFIG']['dbCacheName']` is a string for uniq identify cache entries. This is useful if you have a shared cache like memcache (default value is `md5(/absolute/path/to/bit3/contao-doctrine-dbal-driver/src/Contao/Doctrine/Driver/MySQL/Statement.php)`).

### Different caching in frontend and backend

[](#different-caching-in-frontend-and-backend)

You can add `_FE` or `_BE` to each cache config key, to define different caching in frontend and backend. For example `$GLOBALS['TL_CONFIG']['dbCache_FE']` define the frontend caching mechanism and `$GLOBALS['TL_CONFIG']['dbCacheTTL_BE']` define the backend caching time to live.

Accessing the doctrine dbal connection
--------------------------------------

[](#accessing-the-doctrine-dbal-connection)

If you have installed [bit3/contao-doctrine-dbal](https://github.com/bit3/contao-doctrine-dbal), you should use the dependency injection container:

```
class MyClass
{
	public function myFunc()
	{
		global $container;
		/** @var \Doctrine\DBAL\Connection $connection */
		$connection = $container['doctrine.connection.default'];

		$connection->query('...');
	}
}
```

Alternatively you can get the connection from the database instance:

```
class MyClass
{
	public function myFunc()
	{
		/** @var \Doctrine\DBAL\Connection $connection */
		$connection = Database::getInstance()->getConnection();
	}
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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.

###  Release Activity

Cadence

Every ~15 days

Recently: every ~3 days

Total

51

Last Release

3996d ago

Major Versions

2.11.4 → 3.1.102013-06-04

2.11.5 → 3.0.102013-06-04

2.11.7 → 3.0.122013-06-28

2.11.9 → 3.0.142013-07-10

2.11.11 → 3.0.162015-06-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/233a03a2e2f9a5043fc57a6bf4ae998a2364a64a18a1263bdc11167ffb86cba8?d=identicon)[baumannsven](/maintainers/baumannsven)

![](https://www.gravatar.com/avatar/267ed97e6ff0d8bfb21dc496315426148362bf7cac913c824501d7ed97cd1c41?d=identicon)[dtomasi](/maintainers/dtomasi)

---

Top Contributors

[![tristanlins](https://avatars.githubusercontent.com/u/343404?v=4)](https://github.com/tristanlins "tristanlins (33 commits)")[![baumannsven](https://avatars.githubusercontent.com/u/2493263?v=4)](https://github.com/baumannsven "baumannsven (1 commits)")

---

Tags

databasedoctrinedbaldrivercontao

### Embed Badge

![Health badge](/badges/contaoblackforest-contao-doctrine-dbal-driver/health.svg)

```
[![Health](https://phpackages.com/badges/contaoblackforest-contao-doctrine-dbal-driver/health.svg)](https://phpackages.com/packages/contaoblackforest-contao-doctrine-dbal-driver)
```

###  Alternatives

[friendsofdoctrine/dbal-clickhouse

Doctrine DBAL driver for ClickHouse

1141.2M1](/packages/friendsofdoctrine-dbal-clickhouse)[marktopper/doctrine-dbal-timestamp-type

Add the timestamp type for Doctrine/DBAL

49808.2k1](/packages/marktopper-doctrine-dbal-timestamp-type)[williarin/wordpress-interop

Interoperability library to work with WordPress database in third party apps

6610.9k2](/packages/williarin-wordpress-interop)[nemo64/dbal-rds-data

rds-data driver for doctrine dbal

2713.2k](/packages/nemo64-dbal-rds-data)

PHPackages © 2026

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