PdoPgsql.php 665 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * MINZ - Copyright 2011 Marien Fressinaud
  4. * Sous licence AGPL3 <http://www.gnu.org/licenses/>
  5. */
  6. class Minz_PdoPgsql extends Minz_Pdo {
  7. /** @param array<int,int|string|bool>|null $options */
  8. public function __construct(string $dsn, ?string $username = null, ?string $passwd = null, ?array $options = null) {
  9. parent::__construct($dsn, $username, $passwd, $options);
  10. $this->exec("SET NAMES 'UTF8';");
  11. }
  12. public function dbType(): string {
  13. return 'pgsql';
  14. }
  15. protected function preSql(string $statement): string {
  16. $statement = parent::preSql($statement);
  17. return str_replace(array('`', ' LIKE '), array('"', ' ILIKE '), $statement);
  18. }
  19. }