Download the PHP package bit3/contao-doctrine-dbal-driver without Composer
On this page you can find all versions of the php package bit3/contao-doctrine-dbal-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package contao-doctrine-dbal-driver
Doctrine Database Driver for Contao
To use this database driver, change the driver in your system/config/localconfig.php
:
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:
apc | use apc cache |
---|---|
xcache | use xcache cache |
memcache://<host>[:<port>] | use memcache cache on <host>:<port> |
redis://<host>[:<port>] | use redis cache on <host>:<port> |
redis://<socket> | use redis cache on <socket> file |
array | use array cache |
false | disable 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
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
If you have installed bit3/contao-doctrine-dbal, you should use the dependency injection container:
Alternatively you can get the connection from the database instance:
All versions of contao-doctrine-dbal-driver with dependencies
contao/core Version >=3.2,<3.4-dev
contao-community-alliance/composer-plugin Version ~2.0
doctrine/dbal Version 2.4.*