Skip to content

Instantly share code, notes, and snippets.

@frosas
Last active December 14, 2015 05:08
Show Gist options
  • Save frosas/5032814 to your computer and use it in GitHub Desktop.
Save frosas/5032814 to your computer and use it in GitHub Desktop.
doctrine:
dbal:
driver: pdo_sqlite
path: %kernel.cache_dir%/data.db
parameters:
doctrine.dbal.connection_factory.class: Acme\Bundle\PerProcessConnectionFactory
<?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