Driver.php 662 Bytes
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL\Driver\Mysqli;

5
use Doctrine\DBAL\DBALException;
6
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
7

8
class Driver extends AbstractMySQLDriver
9
{
10 11 12
    /**
     * {@inheritdoc}
     */
13
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
14
    {
15
        try {
Sergei Morozov's avatar
Sergei Morozov committed
16
            return new MysqliConnection($params, (string) $username, (string) $password, $driverOptions);
17 18 19
        } catch (MysqliException $e) {
            throw DBALException::driverException($this, $e);
        }
20 21
    }

22 23 24
    /**
     * {@inheritdoc}
     */
25 26 27 28 29
    public function getName()
    {
        return 'mysqli';
    }
}