Driver.php 864 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Doctrine\DBAL\Driver\Mysqli;
  3. use Doctrine\DBAL\Driver\AbstractMySQLDriver;
  4. use Doctrine\DBAL\Exception;
  5. use Doctrine\Deprecations\Deprecation;
  6. class Driver extends AbstractMySQLDriver
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
  12. {
  13. try {
  14. return new Connection($params, (string) $username, (string) $password, $driverOptions);
  15. } catch (MysqliException $e) {
  16. throw Exception::driverException($this, $e);
  17. }
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function getName()
  23. {
  24. Deprecation::trigger(
  25. 'doctrine/dbal',
  26. 'https://github.com/doctrine/dbal/issues/3580',
  27. 'Driver::getName() is deprecated'
  28. );
  29. return 'mysqli';
  30. }
  31. }