Skip to content

Instantly share code, notes, and snippets.

@ludofleury
Created August 9, 2013 09:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludofleury/6192292 to your computer and use it in GitHub Desktop.
Save ludofleury/6192292 to your computer and use it in GitHub Desktop.
<?php
namespace Playbloom\Tests;
use Doctrine\DBAL\Driver\PDOMySql\Driver;
class MysqlDriver extends Driver
{
private static $connection;
/**
* Attempts to establish a connection with the underlying driver.
*
* @param array $params
* @param string $username
* @param string $password
* @param array $driverOptions
* @return \Doctrine\DBAL\Driver\Connection
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
if (null === self::$connection) {
self::$connection = parent::connect($params, $username, $password, $driverOptions);
}
return self::$connection;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment