Last active
December 14, 2015 05:08
-
-
Save frosas/5032814 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctrine: | |
dbal: | |
driver: pdo_sqlite | |
path: %kernel.cache_dir%/data.db | |
parameters: | |
doctrine.dbal.connection_factory.class: Acme\Bundle\PerProcessConnectionFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Bundle; | |
use Doctrine\Bundle\DoctrineBundle\ConnectionFactory; | |
use Doctrine\Common\EventManager; | |
use Doctrine\DBAL\Configuration; | |
class PerProcessConnectionFactory extends ConnectionFactory | |
{ | |
function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = array()) | |
{ | |
$params['path'] = $params['path'] . '-' . getmypid(); | |
return parent::createConnection($params, $config, $eventManager, $mappingTypes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment