vendor\kafoso\doctrine-firebird-driver\src\Driver\FirebirdInterbase\Driver.php line 8

Open in your IDE?
  1. <?php
  2. namespace IST\DoctrineFirebirdDriver\Driver\FirebirdInterbase;
  3. use Doctrine\DBAL\DBALException;
  4. use IST\DoctrineFirebirdDriver\Driver\AbstractFirebirdInterbaseDriver;
  5. use IST\DoctrineFirebirdDriver\Driver\FirebirdInterbase\Configuration;
  6. class Driver extends AbstractFirebirdInterbaseDriver
  7. {
  8.     public function __construct()
  9.     {
  10.         parent::__construct();
  11.         if ($this->configuration == null) {
  12.             if (empty($_ENV['DB_NAME'])) {
  13.                 throw new Exception('"DB_NAME" değeri geçersiz!');
  14.             }
  15.             $this->configuration = new Configuration(
  16.                 $_ENV['DB_HOST'] ?? 'localhost',
  17.                 $_ENV['DB_PORT'] ?? 3050,
  18.                 $_ENV['DB_NAME'],
  19.                 $_ENV['DB_USER'] ?? 'SYSDBA',
  20.                 $_ENV['DB_PASSWORD'] ?? 'masterkey',
  21.                 $_ENV['DB_CHARSET'] ?? 'UTF-8',
  22.                 0,
  23.                 $_ENV['DB_DIALECT'] ?? 3
  24.             );
  25.         }
  26.     }
  27.     /**
  28.      * @param array $params                     N/A.
  29.      * @param ?string $username                 N/A.
  30.      * @param ?string $password                 N/A.
  31.      * @param array $driverOptions              N/A.
  32.      * {@inheritdoc}
  33.      */
  34.     public function connect(array $params$username null$password null, array $driverOptions = array())
  35.     {
  36.         try {
  37.             return new Connection($this->configuration);
  38.         } catch (Exception $e) {
  39.             throw DBALException::driverException($this$e);
  40.         }
  41.     }
  42.     /**
  43.      * {@inheritdoc}
  44.      */
  45.     public function getName()
  46.     {
  47.         return 'FirebirdInterbase';
  48.     }
  49. }