PdoPgsql.php 556 B

12345678910111213141516171819202122
  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. public function __construct($dsn, $username = null, $passwd = null, $options = null) {
  8. parent::__construct($dsn, $username, $passwd, $options);
  9. $this->exec("SET NAMES 'UTF8';");
  10. }
  11. public function dbType() {
  12. return 'pgsql';
  13. }
  14. protected function preSql($statement) {
  15. $statement = parent::preSql($statement);
  16. return str_replace(array('`', ' LIKE '), array('"', ' ILIKE '), $statement);
  17. }
  18. }